Skip to content

Commit

Permalink
replace 0 by NF_NOWRITE, improve (?) error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mjlosch committed Nov 14, 2024
1 parent d577cec commit cdd59dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/profiles/profiles_init_fixed.F
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ SUBROUTINE profiles_init_fixed( myThid )
C===========================================================

WRITE(fnamedatanc,'(2a)') profilesfile(1:IL),'.nc'
err = NF_OPEN(fnamedatanc, 0, fiddata(num_file,bi,bj))
err = NF_OPEN(fnamedatanc, NF_NOWRITE, fiddata(num_file,bi,bj))
CALL PROFILES_NF_ERROR( 'INIT_FIXED 1: NF_OPEN:',
& err,bi,bj,myThid )

Expand Down
5 changes: 3 additions & 2 deletions pkg/profiles/profiles_init_varia.F
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ subroutine profiles_init_varia( mythid )
if (ProfNo(num_file,bi,bj).GT.0) then
C Close .equi file so data in buffer is not lost when run finishes
err = NF_CLOSE(fidforward(num_file,bi,bj))
CALL PROFILES_NF_ERROR( 'INIT_VAIRA 1: NF_CLOSE',
CALL PROFILES_NF_ERROR( 'INIT_VARIA: NF_CLOSE',
& err,bi,bj,myThid )

C determine model equivalent file name
Expand All @@ -102,7 +102,8 @@ subroutine profiles_init_varia( mythid )
JL = ILNBLNK( fnameequinc )
err = NF_OPEN( fnameequinc(1:JL),NF_WRITE,
& fidforward(num_file,bi,bj))
CALL PROFILES_NF_ERROR( 'INIT_VAIRA 2: NF_OPEN',
CALL PROFILES_NF_ERROR(
& 'INIT_VARIA: NF_OPEN('//fnameequinc(1:JL)//')',
& err,bi,bj,myThid )
endif
enddo
Expand Down

0 comments on commit cdd59dd

Please sign in to comment.