- Timestamp:
- 2018-11-25T15:24:21+01:00 (5 years ago)
- Location:
- NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/SAS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/SAS/diawri.F90
r10297 r10358 39 39 USE ioipsl 40 40 #if defined key_si3 41 USE ice 41 42 USE icewri 42 43 #endif … … 93 94 ! Output the initial state and forcings 94 95 IF( ninist == 1 ) THEN 95 CALL dia_wri_state( 'output.init' , kt)96 CALL dia_wri_state( 'output.init' ) 96 97 ninist = 0 97 98 ENDIF … … 142 143 ! Output the initial state and forcings 143 144 IF( ninist == 1 ) THEN 144 CALL dia_wri_state( 'output.init' , kt)145 CALL dia_wri_state( 'output.init' ) 145 146 ninist = 0 146 147 ENDIF … … 329 330 #endif 330 331 331 SUBROUTINE dia_wri_state( cdfile_name , kt)332 SUBROUTINE dia_wri_state( cdfile_name ) 332 333 !!--------------------------------------------------------------------- 333 334 !! *** ROUTINE dia_wri_state *** … … 343 344 !!---------------------------------------------------------------------- 344 345 CHARACTER (len=* ), INTENT( in ) :: cdfile_name ! name of the file created 345 INTEGER , INTENT( in ) :: kt ! ocean time-step index 346 !! 347 CHARACTER (len=32) :: clname 348 CHARACTER (len=40) :: clop 349 INTEGER :: id_i , nz_i, nh_i 350 INTEGER, DIMENSION(1) :: idex ! local workspace 351 REAL(wp) :: zsto, zout, zmax, zjulian 346 !! 347 INTEGER :: inum 352 348 !!---------------------------------------------------------------------- 353 349 ! 354 IF( ln_timing ) CALL timing_start('dia_wri_state')355 356 ! 0. Initialisation357 ! -----------------358 359 ! Define name, frequency of output and means360 clname = cdfile_name361 IF( .NOT. Agrif_Root() ) clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname)362 zsto = rdt363 clop = "inst(x)" ! no use of the mask value (require less cpu time)364 zout = rdt365 zmax = ( nitend - nit000 + 1 ) * rdt366 367 350 IF(lwp) WRITE(numout,*) 368 351 IF(lwp) WRITE(numout,*) 'dia_wri_state : single instantaneous ocean state' 369 352 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~ and forcing fields file created ' 370 IF(lwp) WRITE(numout,*) ' and named :', clname, '.nc' 371 372 373 ! 1. Define NETCDF files and fields at beginning of first time step 374 ! ----------------------------------------------------------------- 375 376 ! Compute julian date from starting date of the run 377 CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian ) ! time axis 378 zjulian = zjulian - adatrj ! set calendar origin to the beginning of the experiment 379 CALL histbeg( clname, jpi, glamt, jpj, gphit, & 380 1, jpi, 1, jpj, nit000-1, zjulian, rdt, nh_i, id_i, domain_id=nidom, snc4chunks=snc4set ) ! Horizontal grid : glamt and gphit 381 CALL histvert( id_i, "deptht", "Vertical T levels", & ! Vertical grid : gdept 382 "m", jpk, gdept_1d, nz_i, "down") 383 384 ! Declare all the output fields as NetCDF variables 385 386 CALL histdef( id_i, "sowaflup", "Net Upward Water Flux" , "Kg/m2/S", & ! net freshwater 387 & jpi, jpj, nh_i, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 388 CALL histdef( id_i, "sohefldo", "Net Downward Heat Flux", "W/m2" , & ! net heat flux 389 & jpi, jpj, nh_i, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 390 CALL histdef( id_i, "soshfldo", "Shortwave Radiation" , "W/m2" , & ! solar flux 391 & jpi, jpj, nh_i, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 392 CALL histdef( id_i, "soicecov", "Ice fraction" , "[0,1]" , & ! fr_i 393 & jpi, jpj, nh_i, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 394 CALL histdef( id_i, "sozotaux", "Zonal Wind Stress" , "N/m2" , & ! i-wind stress 395 & jpi, jpj, nh_i, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 396 CALL histdef( id_i, "sometauy", "Meridional Wind Stress", "N/m2" , & ! j-wind stress 397 & jpi, jpj, nh_i, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 353 IF(lwp) WRITE(numout,*) ' and named :', cdfile_name, '...nc' 398 354 399 355 #if defined key_si3 400 IF( nn_ice == 2 ) THEN ! condition needed in case agrif + lim but no-ice in child grid 401 CALL ice_wri_state( kt, id_i, nh_i ) 402 ENDIF 356 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., kiolib = jprstlib, kdlev = jpl ) 403 357 #else 404 CALL histend( id_i, snc4chunks=snc4set ) 405 #endif 406 407 ! 2. Start writing data 408 ! --------------------- 409 ! idex(1) est utilise ssi l'avant dernier argument est diffferent de 410 ! la taille du tableau en sortie. Dans ce cas , l'avant dernier argument 411 ! donne le nombre d'elements, et idex la liste des indices a sortir 412 idex(1) = 1 ! init to avoid compil warning 413 414 ! Write all fields on T grid 415 CALL histwrite( id_i, "sowaflup", kt, emp , jpi*jpj , idex ) ! freshwater budget 416 CALL histwrite( id_i, "sohefldo", kt, qsr + qns , jpi*jpj , idex ) ! total heat flux 417 CALL histwrite( id_i, "soshfldo", kt, qsr , jpi*jpj , idex ) ! solar heat flux 418 CALL histwrite( id_i, "soicecov", kt, fr_i , jpi*jpj , idex ) ! ice fraction 419 CALL histwrite( id_i, "sozotaux", kt, utau , jpi*jpj , idex ) ! i-wind stress 420 CALL histwrite( id_i, "sometauy", kt, vtau , jpi*jpj , idex ) ! j-wind stress 421 422 ! 3. Close the file 423 ! ----------------- 424 CALL histclo( id_i ) 425 #if ! defined key_iomput 426 IF( ninist /= 1 ) THEN 427 CALL histclo( nid_T ) 428 CALL histclo( nid_U ) 429 CALL histclo( nid_V ) 430 ENDIF 431 #endif 432 ! 433 IF( ln_timing ) CALL timing_stop('dia_wri_state') 358 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., kiolib = jprstlib ) 359 #endif 360 361 CALL iom_rstput( 0, 0, inum, 'votemper', tsn(:,:,:,jp_tem) ) ! now temperature 362 CALL iom_rstput( 0, 0, inum, 'vosaline', tsn(:,:,:,jp_sal) ) ! now salinity 363 CALL iom_rstput( 0, 0, inum, 'sossheig', sshn ) ! sea surface height 364 CALL iom_rstput( 0, 0, inum, 'vozocrtx', un ) ! now i-velocity 365 CALL iom_rstput( 0, 0, inum, 'vomecrty', vn ) ! now j-velocity 366 CALL iom_rstput( 0, 0, inum, 'vovecrtz', wn ) ! now k-velocity 367 CALL iom_rstput( 0, 0, inum, 'sowaflup', emp - rnf ) ! freshwater budget 368 CALL iom_rstput( 0, 0, inum, 'sohefldo', qsr + qns ) ! total heat flux 369 CALL iom_rstput( 0, 0, inum, 'soshfldo', qsr ) ! solar heat flux 370 CALL iom_rstput( 0, 0, inum, 'soicecov', fr_i ) ! ice fraction 371 CALL iom_rstput( 0, 0, inum, 'sozotaux', utau ) ! i-wind stress 372 CALL iom_rstput( 0, 0, inum, 'sometauy', vtau ) ! j-wind stress 373 374 #if defined key_si3 375 IF( nn_ice == 2 ) THEN ! condition needed in case agrif + ice-model but no-ice in child grid 376 CALL ice_wri_state( inum ) 377 ENDIF 378 #endif 379 ! 380 CALL iom_close( inum ) 434 381 ! 435 382 END SUBROUTINE dia_wri_state -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/SAS/step.F90
r10068 r10358 121 121 IF( indic < 0 ) THEN 122 122 CALL ctl_stop( 'step: indic < 0' ) 123 CALL dia_wri_state( 'output.abort' , kstp)123 CALL dia_wri_state( 'output.abort' ) 124 124 ENDIF 125 125 IF( kstp == nit000 ) CALL iom_close( numror ) ! close input ocean restart file -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/SAS/stpctl.F90
r10314 r10358 32 32 33 33 INTEGER :: idrun, idtime, idssh, idu, ids, istatus 34 LOGICAL :: lsomeoce 34 35 !!---------------------------------------------------------------------- 35 36 !! NEMO/SAS 4.0 , NEMO Consortium (2018) … … 57 58 !! 58 59 REAL(wp), DIMENSION(3) :: zmax 60 CHARACTER(len=20) :: clname 59 61 !!---------------------------------------------------------------------- 60 62 … … 64 66 WRITE(numout,*) '~~~~~~~' 65 67 ! ! open time.step file 66 CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )68 IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 67 69 ! ! open run.stat file 68 CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 69 70 IF( lwm ) THEN 70 IF( ln_ctl .AND. lwm ) THEN 71 CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 72 clname = 'run.stat.nc' 73 IF( .NOT. Agrif_Root() ) clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 71 74 istatus = NF90_CREATE( 'run.stat.nc', NF90_CLOBBER, idrun ) 72 75 istatus = NF90_DEF_DIM( idrun, 'time' , NF90_UNLIMITED, idtime ) … … 76 79 istatus = NF90_ENDDEF(idrun) 77 80 ENDIF 78 79 81 ENDIF 82 IF( kt == nit000 ) lsomeoce = COUNT( ssmask(:,:) == 1._wp ) > 0 80 83 ! 81 IF(lw p) THEN !== current time step ==! ("time.step" file)84 IF(lwm) THEN !== current time step ==! ("time.step" file) 82 85 WRITE ( numstp, '(1x, i8)' ) kt 83 86 REWIND( numstp ) 84 87 ENDIF 85 88 ! !== test of extrema ==! 86 zmax(1) = MAXVAL( vt_i (:,:) ) ! max ice thickness 87 zmax(2) = MAXVAL( ABS( u_ice(:,:) ) ) ! max ice velocity (zonal only) 88 zmax(3) = MAXVAL( -tm_i (:,:)+273.15_wp , mask = ssmask(:,:) == 1._wp ) ! min ice temperature 89 ! 90 IF( lk_mpp ) CALL mpp_max( "stpctl", zmax ) ! max over the global domain 91 ! 92 IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN 93 WRITE(numout,*) ' ==>> time-step= ', kt, ' vt_i max: ', zmax(1), ' |u_ice| max: ', zmax(2), ' tm_i min: ', -zmax(3) 94 ENDIF 95 89 IF( ln_ctl ) THEN ! must be done by all processes because of the mpp_max 90 zmax(1) = MAXVAL( vt_i (:,:) ) ! max ice thickness 91 zmax(2) = MAXVAL( ABS( u_ice(:,:) ) ) ! max ice velocity (zonal only) 92 zmax(3) = MAXVAL( -tm_i (:,:)+273.15_wp , mask = ssmask(:,:) == 1._wp ) ! min ice temperature 93 IF( lk_mpp ) CALL mpp_max( "stpctl", zmax ) ! max over the global domain 94 END IF 96 95 ! !== run statistics ==! ("run.stat" file) 97 IF( lwp) WRITE(numrun,9400) kt, zmax(1), zmax(2), - zmax(3)98 IF( lwm ) THEN96 IF( ln_ctl .AND. lwm ) THEN 97 IF(lwp) WRITE(numrun,9500) kt, zmax(1), zmax(2), - zmax(3) 99 98 istatus = NF90_PUT_VAR( idrun, idssh, (/ zmax(1)/), (/kt/), (/1/) ) 100 99 istatus = NF90_PUT_VAR( idrun, idu, (/ zmax(2)/), (/kt/), (/1/) ) … … 104 103 END IF 105 104 ! 106 9 400 FORMAT(' it :', i8, ' vt_i_max: ', D23.16, ' |u|_max: ', D23.16,' tm_i_min: ', D23.16)105 9500 FORMAT(' it :', i8, ' vt_i_max: ', D23.16, ' |u|_max: ', D23.16,' tm_i_min: ', D23.16) 107 106 ! 108 107 END SUBROUTINE stp_ctl
Note: See TracChangeset
for help on using the changeset viewer.