Changeset 12377 for NEMO/trunk/src/SAS/diawri.F90
- Timestamp:
- 2020-02-12T15:39:06+01:00 (4 years ago)
- Location:
- NEMO/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk
- Property svn:externals
-
old new 3 3 ^/utils/build/mk@HEAD mk 4 4 ^/utils/tools@HEAD tools 5 ^/vendors/AGRIF/dev @HEAD ext/AGRIF5 ^/vendors/AGRIF/dev_r11615_ENHANCE-04_namelists_as_internalfiles_agrif@HEAD ext/AGRIF 6 6 ^/vendors/FCM@HEAD ext/FCM 7 7 ^/vendors/IOIPSL@HEAD ext/IOIPSL
-
- Property svn:externals
-
NEMO/trunk/src/SAS/diawri.F90
r11536 r12377 24 24 !!---------------------------------------------------------------------- 25 25 USE oce ! ocean dynamics and tracers 26 USE abl ! abl variables in case ln_abl = .true. 26 27 USE dom_oce ! ocean space and time domain 27 28 USE zdf_oce ! ocean vertical physics … … 51 52 PUBLIC dia_wri_state 52 53 PUBLIC dia_wri_alloc ! Called by nemogcm module 53 54 #if ! defined key_iomput 55 PUBLIC dia_wri_alloc_abl ! Called by sbcabl module (if ln_abl = .true.) 56 #endif 54 57 INTEGER :: nid_T, nz_T, nh_T, ndim_T, ndim_hT ! grid_T file 55 58 INTEGER :: nid_U, nz_U, nh_U, ndim_U, ndim_hU ! grid_U file 56 59 INTEGER :: nid_V, nz_V, nh_V, ndim_V, ndim_hV ! grid_V file 60 INTEGER :: ndim_A, ndim_hA ! ABL file 61 INTEGER :: nid_A, nz_A, nh_A ! grid_ABL file 57 62 INTEGER :: ndex(1) ! ??? 58 63 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hT, ndex_hU, ndex_hV 59 60 !! * Substitutions 61 # include "vectopt_loop_substitute.h90" 64 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hA, ndex_A ! ABL 65 62 66 !!---------------------------------------------------------------------- 63 67 !! NEMO/SAS 4.0 , NEMO Consortium (2018) … … 78 82 79 83 80 SUBROUTINE dia_wri( kt )84 SUBROUTINE dia_wri( kt, Kmm ) 81 85 !!--------------------------------------------------------------------- 82 86 !! *** ROUTINE dia_wri *** … … 90 94 !! 91 95 INTEGER, INTENT( in ) :: kt ! ocean time-step index 96 INTEGER, INTENT( in ) :: Kmm ! ocean time levelindex 92 97 !!---------------------------------------------------------------------- 93 98 ! 94 99 ! Output the initial state and forcings 95 100 IF( ninist == 1 ) THEN 96 CALL dia_wri_state( 'output.init' )101 CALL dia_wri_state( 'output.init', Kmm ) 97 102 ninist = 0 98 103 ENDIF … … 114 119 END FUNCTION dia_wri_alloc 115 120 121 INTEGER FUNCTION dia_wri_alloc_abl() 122 !!---------------------------------------------------------------------- 123 ALLOCATE( ndex_hA(jpi*jpj), ndex_A (jpi*jpj*jpkam1), STAT=dia_wri_alloc_abl) 124 CALL mpp_sum( 'diawri', dia_wri_alloc_abl ) 125 ! 126 END FUNCTION dia_wri_alloc_abl 116 127 117 128 SUBROUTINE dia_wri( kt ) … … 136 147 INTEGER :: ierr ! error code return from allocation 137 148 INTEGER :: iimi, iima, ipk, it, itmod, ijmi, ijma ! local integers 149 INTEGER :: ipka ! ABL 138 150 REAL(wp) :: zsto, zout, zmax, zjulian ! local scalars 151 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zw3d_abl ! ABL 3D workspace 139 152 !!---------------------------------------------------------------------- 140 153 ! … … 174 187 ijmi = 1 ; ijma = jpj 175 188 ipk = jpk 189 IF(ln_abl) ipka = jpkam1 176 190 177 191 ! define time axis … … 241 255 242 256 ! No W grid FILE 257 IF( ln_abl ) THEN 258 ! Define the ABL grid FILE ( nid_A ) 259 CALL dia_nam( clhstnam, nwrite, 'grid_ABL' ) 260 IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam ! filename 261 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & ! Horizontal grid: glamt and gphit 262 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 263 & nit000-1, zjulian, rdt, nh_A, nid_A, domain_id=nidom, snc4chunks=snc4set ) 264 CALL histvert( nid_A, "ght_abl", "Vertical T levels", & ! Vertical grid: gdept 265 & "m", ipka, ght_abl(2:jpka), nz_A, "up" ) 266 ! ! Index of ocean points 267 ALLOCATE( zw3d_abl(jpi,jpj,ipka) ) 268 zw3d_abl(:,:,:) = 1._wp 269 CALL wheneq( jpi*jpj*ipka, zw3d_abl, 1, 1., ndex_A , ndim_A ) ! volume 270 CALL wheneq( jpi*jpj , zw3d_abl, 1, 1., ndex_hA, ndim_hA ) ! surface 271 DEALLOCATE(zw3d_abl) 272 ENDIF 243 273 244 274 ! Declare all the output fields as NETCDF variables … … 261 291 CALL histdef( nid_T, "sowindsp", "wind speed at 10m" , "m/s" , & ! wndm 262 292 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 293 ! 294 IF( ln_abl ) THEN 295 ! !!! nid_A : 3D 296 CALL histdef( nid_A, "t_abl", "Potential Temperature" , "K" , & ! t_abl 297 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 298 CALL histdef( nid_A, "q_abl", "Humidity" , "kg/kg" , & ! q_abl 299 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 300 CALL histdef( nid_A, "u_abl", "Atmospheric U-wind " , "m/s" , & ! u_abl 301 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 302 CALL histdef( nid_A, "v_abl", "Atmospheric V-wind " , "m/s" , & ! v_abl 303 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 304 CALL histdef( nid_A, "tke_abl", "Atmospheric TKE " , "m2/s2" , & ! tke_abl 305 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 306 CALL histdef( nid_A, "avm_abl", "Atmospheric turbulent viscosity", "m2/s" , & ! avm_abl 307 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 308 CALL histdef( nid_A, "avt_abl", "Atmospheric turbulent diffusivity", "m2/s2", & ! avt_abl 309 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 310 CALL histdef( nid_A, "pblh", "Atmospheric boundary layer height " , "m", & ! pblh 311 & jpi, jpj, nh_A, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 312 #if defined key_si3 313 CALL histdef( nid_A, "oce_frac", "Fraction of open ocean" , " ", & ! ato_i 314 & jpi, jpj, nh_A, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 315 #endif 316 CALL histend( nid_A, snc4chunks=snc4set ) 317 ! 318 ENDIF 319 ! 263 320 264 321 CALL histend( nid_T, snc4chunks=snc4set ) … … 310 367 CALL histwrite( nid_T, "soicecov", it, fr_i , ndim_hT, ndex_hT ) ! ice fraction 311 368 CALL histwrite( nid_T, "sowindsp", it, wndm , ndim_hT, ndex_hT ) ! wind speed 369 ! 370 IF( ln_abl ) THEN 371 ALLOCATE( zw3d_abl(jpi,jpj,jpka) ) 372 IF( ln_mskland ) THEN 373 DO jk=1,jpka 374 zw3d_abl(:,:,jk) = tmask(:,:,1) 375 END DO 376 ELSE 377 zw3d_abl(:,:,:) = 1._wp 378 ENDIF 379 CALL histwrite( nid_A, "pblh" , it, pblh(:,:) *zw3d_abl(:,:,1 ), ndim_hA, ndex_hA ) ! pblh 380 CALL histwrite( nid_A, "u_abl" , it, u_abl (:,:,2:jpka,nt_n )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! u_abl 381 CALL histwrite( nid_A, "v_abl" , it, v_abl (:,:,2:jpka,nt_n )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! v_abl 382 CALL histwrite( nid_A, "t_abl" , it, tq_abl (:,:,2:jpka,nt_n,1)*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! t_abl 383 CALL histwrite( nid_A, "q_abl" , it, tq_abl (:,:,2:jpka,nt_n,2)*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! q_abl 384 CALL histwrite( nid_A, "tke_abl", it, tke_abl (:,:,2:jpka,nt_n )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! tke_abl 385 CALL histwrite( nid_A, "avm_abl", it, avm_abl (:,:,2:jpka )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! avm_abl 386 CALL histwrite( nid_A, "avt_abl", it, avt_abl (:,:,2:jpka )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! avt_abl 387 #if defined key_si3 388 CALL histwrite( nid_A, "oce_frac" , it, ato_i(:,:) , ndim_hA, ndex_hA ) ! ato_i 389 #endif 390 DEALLOCATE(zw3d_abl) 391 ENDIF 392 ! 312 393 313 394 ! Write fields on U grid … … 325 406 CALL histclo( nid_U ) 326 407 CALL histclo( nid_V ) 408 IF(ln_abl) CALL histclo( nid_A ) 327 409 ENDIF 328 410 ! … … 332 414 #endif 333 415 334 SUBROUTINE dia_wri_state( cdfile_name )416 SUBROUTINE dia_wri_state( cdfile_name, Kmm ) 335 417 !!--------------------------------------------------------------------- 336 418 !! *** ROUTINE dia_wri_state *** … … 346 428 !!---------------------------------------------------------------------- 347 429 CHARACTER (len=* ), INTENT( in ) :: cdfile_name ! name of the file created 430 INTEGER , INTENT( in ) :: Kmm ! ocean time levelindex 348 431 !! 349 432 INTEGER :: inum … … 361 444 #endif 362 445 363 CALL iom_rstput( 0, 0, inum, 'votemper', ts n(:,:,:,jp_tem) ) ! now temperature364 CALL iom_rstput( 0, 0, inum, 'vosaline', ts n(:,:,:,jp_sal) ) ! now salinity365 CALL iom_rstput( 0, 0, inum, 'sossheig', ssh n) ! sea surface height366 CALL iom_rstput( 0, 0, inum, 'vozocrtx', u n) ! now i-velocity367 CALL iom_rstput( 0, 0, inum, 'vomecrty', v n) ! now j-velocity368 CALL iom_rstput( 0, 0, inum, 'vovecrtz', w n) ! now k-velocity369 CALL iom_rstput( 0, 0, inum, 'sowaflup', emp - rnf ) ! freshwater budget370 CALL iom_rstput( 0, 0, inum, 'sohefldo', qsr + qns ) ! total heat flux371 CALL iom_rstput( 0, 0, inum, 'soshfldo', qsr ) ! solar heat flux372 CALL iom_rstput( 0, 0, inum, 'soicecov', fr_i ) ! ice fraction373 CALL iom_rstput( 0, 0, inum, 'sozotaux', utau ) ! i-wind stress374 CALL iom_rstput( 0, 0, inum, 'sometauy', vtau ) ! j-wind stress446 CALL iom_rstput( 0, 0, inum, 'votemper', ts (:,:,:,jp_tem,Kmm) ) ! now temperature 447 CALL iom_rstput( 0, 0, inum, 'vosaline', ts (:,:,:,jp_sal,Kmm) ) ! now salinity 448 CALL iom_rstput( 0, 0, inum, 'sossheig', ssh(:,:, Kmm) ) ! sea surface height 449 CALL iom_rstput( 0, 0, inum, 'vozocrtx', uu (:,:,:, Kmm) ) ! now i-velocity 450 CALL iom_rstput( 0, 0, inum, 'vomecrty', vv (:,:,:, Kmm) ) ! now j-velocity 451 CALL iom_rstput( 0, 0, inum, 'vovecrtz', ww ) ! now k-velocity 452 CALL iom_rstput( 0, 0, inum, 'sowaflup', emp - rnf ) ! freshwater budget 453 CALL iom_rstput( 0, 0, inum, 'sohefldo', qsr + qns ) ! total heat flux 454 CALL iom_rstput( 0, 0, inum, 'soshfldo', qsr ) ! solar heat flux 455 CALL iom_rstput( 0, 0, inum, 'soicecov', fr_i ) ! ice fraction 456 CALL iom_rstput( 0, 0, inum, 'sozotaux', utau ) ! i-wind stress 457 CALL iom_rstput( 0, 0, inum, 'sometauy', vtau ) ! j-wind stress 375 458 376 459 #if defined key_si3
Note: See TracChangeset
for help on using the changeset viewer.