Changeset 3870 for trunk/LMDZ.MARS/libf/phymars/writediagfi.F
- Timestamp:
- Jul 29, 2025, 3:51:19 PM (5 months ago)
- File:
-
- 1 edited
-
trunk/LMDZ.MARS/libf/phymars/writediagfi.F (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/writediagfi.F
r3369 r3870 74 74 REAL area((nbp_lon+1),nbp_lat) 75 75 76 integer isample76 integer, save :: isample 77 77 integer ierr,ierr2 78 78 integer i,j,l, ig0 … … 122 122 123 123 !*************************************************************** 124 ! Compute the output rate125 126 isample=steps_per_sol/outputs_per_sol127 128 !***************************************************************129 124 130 125 ! At very first call, check if there is a "diagfi.def" to use and read it … … 132 127 IF (firstcall) THEN 133 128 firstcall=.false. 129 130 ! Compute the output rate 131 isample=steps_per_sol/outputs_per_sol 134 132 135 133 !$OMP MASTER … … 251 249 ENDIF 252 250 251 ierr= NF_CLOSE(nid) ! Close the NETCDF file once initialized 252 253 253 endif ! of if (is_master) 254 255 else256 257 if (is_master) then258 ! only the master is required to do this259 260 ! Open the NetCDF file261 ierr = NF_OPEN(fichnom,NF_WRITE,nid)262 endif ! of if (is_master)263 264 254 endif ! if (firstnom.eq.'1234567890') 265 255 … … 276 266 277 267 if ( MOD(zitau+1,isample) .eq.0.) then 278 268 279 269 ! Compute/write/extend 'Time' coordinate (date given in days) 280 270 ! (done every "first call" (at given time level) to writediagfi) 281 271 ! Note: date is incremented as 1 step ahead of physics time 282 272 !-------------------------------------------------------- 283 284 273 if (is_master) then 285 ! only the master is required to do this 286 if (nom.eq.firstnom) then 287 ! We have identified a "first call" (at given date) 288 ntime=ntime+1 ! increment # of stored time steps 289 ! compute corresponding date (in days and fractions thereof) 290 date=(zitau +1.)/steps_per_sol 291 ! Get NetCDF ID of 'Time' variable 292 ierr= NF_INQ_VARID(nid,"Time",varid) 293 ! Write (append) the new date to the 'Time' array 294 !#ifdef NC_DOUBLE 295 ! ierr= NF_PUT_VARA_DOUBLE(nid,varid,[ntime],[1],[date]) 274 ! only the master is required to do this 275 276 ! Time to write data, open NETCDF file 277 ierr=NF_OPEN(fichnom,NF_WRITE,nid) 278 279 if (nom.eq.firstnom) then 280 ! We have identified a "first call" (at given date) 281 ntime=ntime+1 ! increment # of stored time steps 282 ! compute corresponding date (in days and fractions thereof) 283 date=(zitau +1.)/steps_per_sol 284 ! Get NetCDF ID of 'Time' variable 285 ierr= NF_INQ_VARID(nid,"Time",varid) 286 ! Write (append) the new date to the 'Time' array 287 !#ifdef NC_DOUBLE 288 ! ierr= NF_PUT_VARA_DOUBLE(nid,varid,[ntime],[1],[date]) 296 289 !#else 297 ierr= NF_PUT_VARA_REAL(nid,varid,[ntime],[1],[date])290 ierr= NF_PUT_VARA_REAL(nid,varid,[ntime],[1],[date]) 298 291 !#endif 299 if (ierr.ne.NF_NOERR) then 300 write(*,*) "***** PUT_VAR matter in writediagfi_nc" 301 write(*,*) "***** with time" 302 write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr) 303 c call abort 304 endif 305 306 write(6,*)'WRITEDIAGFI: date= ', date 307 end if ! of if (nom.eq.firstnom) 308 292 if (ierr.ne.NF_NOERR) then 293 write(*,*) "***** PUT_VAR matter in writediagfi_nc" 294 write(*,*) "***** with time" 295 write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr) 296 c call abort 297 endif 298 299 write(6,*)'WRITEDIAGFI: date= ', date 300 end if ! of if (nom.eq.firstnom) 309 301 endif ! of if (is_master) 310 302 … … 621 613 endif ! of if (dim.eq.3) elseif(dim.eq.2)... 622 614 615 if (is_master) then 616 ! Close until next variable to dump or next dump iteration 617 ierr= NF_CLOSE(nid) 618 endif 619 623 620 endif ! of if ( MOD(zitau+1,isample) .eq.0.) 624 621 625 if (is_master) then626 ierr= NF_CLOSE(nid)627 endif628 629 622 end
Note: See TracChangeset
for help on using the changeset viewer.
