- Timestamp:
- 2020-06-24T14:38:26+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r12527_Gurvan_ShallowWater/src/OCE/DIA/diaar5.F90
r12489 r13151 32 32 REAL(wp) :: vol0 ! ocean volume (interior domain) 33 33 REAL(wp) :: area_tot ! total ocean surface (interior domain) 34 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,: ) :: area ! cell surface (interior domain)35 34 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,: ) :: thick0 ! ocean thickness (interior domain) 36 35 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: sn0 ! initial salinity … … 40 39 !! * Substitutions 41 40 # include "do_loop_substitute.h90" 41 # include "domzgr_substitute.h90" 42 42 !!---------------------------------------------------------------------- 43 43 !! NEMO/OCE 4.0 , NEMO Consortium (2018) … … 54 54 !!---------------------------------------------------------------------- 55 55 ! 56 ALLOCATE( area(jpi,jpj),thick0(jpi,jpj) , sn0(jpi,jpj,jpk) , STAT=dia_ar5_alloc )56 ALLOCATE( thick0(jpi,jpj) , sn0(jpi,jpj,jpk) , STAT=dia_ar5_alloc ) 57 57 ! 58 58 CALL mpp_sum ( 'diaar5', dia_ar5_alloc ) … … 77 77 ! 78 78 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zarea_ssh , zbotpres ! 2D workspace 79 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z pe, z2d! 2D workspace80 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z rhd , zrhop, ztpot ! 3D workspace79 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z2d, zpe ! 2D workspace 80 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z3d, zrhd , zrhop, ztpot, zgdept ! 3D workspace (zgdept: needed to use the substitute) 81 81 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: ztsn ! 4D workspace 82 82 … … 90 90 ALLOCATE( zrhd(jpi,jpj,jpk) , zrhop(jpi,jpj,jpk) ) 91 91 ALLOCATE( ztsn(jpi,jpj,jpk,jpts) ) 92 zarea_ssh(:,:) = area(:,:) * ssh(:,:,Kmm)93 ENDIF 94 ! 95 CALL iom_put( 'e2u' , e2u (:,:) )96 CALL iom_put( 'e1v' , e1v (:,:) )97 CALL iom_put( 'areacello', area(:,:) )92 zarea_ssh(:,:) = e1e2t(:,:) * ssh(:,:,Kmm) 93 ENDIF 94 ! 95 CALL iom_put( 'e2u' , e2u (:,:) ) 96 CALL iom_put( 'e1v' , e1v (:,:) ) 97 CALL iom_put( 'areacello', e1e2t(:,:) ) 98 98 ! 99 99 IF( iom_use( 'volcello' ) .OR. iom_use( 'masscello' ) ) THEN 100 100 zrhd(:,:,jpk) = 0._wp ! ocean volume ; rhd is used as workspace 101 101 DO jk = 1, jpkm1 102 zrhd(:,:,jk) = area(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk)102 zrhd(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 103 103 END DO 104 DO jk = 1, jpk 105 z3d(:,:,jk) = rho0 * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 106 END DO 104 107 CALL iom_put( 'volcello' , zrhd(:,:,:) ) ! WARNING not consistent with CMIP DR where volcello is at ca. 2000 105 CALL iom_put( 'masscello' , rho0 * e3t(:,:,:,Kmm) * tmask(:,:,:) )! ocean mass108 CALL iom_put( 'masscello' , z3d (:,:,:) ) ! ocean mass 106 109 ENDIF 107 110 ! … … 129 132 ztsn(:,:,:,jp_tem) = ts(:,:,:,jp_tem,Kmm) ! thermosteric ssh 130 133 ztsn(:,:,:,jp_sal) = sn0(:,:,:) 131 CALL eos( ztsn, zrhd, gdept(:,:,:,Kmm) ) ! now in situ density using initial salinity 134 DO jk = 1, jpk 135 zgdept(:,:,jk) = gdept(:,:,jk,Kmm) 136 END DO 137 CALL eos( ztsn, zrhd, zgdept) ! now in situ density using initial salinity 132 138 ! 133 139 zbotpres(:,:) = 0._wp ! no atmospheric surface pressure, levitating sea-ice … … 151 157 END IF 152 158 ! 153 zarho = glob_sum( 'diaar5', area(:,:) * zbotpres(:,:) )159 zarho = glob_sum( 'diaar5', e1e2t(:,:) * zbotpres(:,:) ) 154 160 zssh_steric = - zarho / area_tot 155 161 CALL iom_put( 'sshthster', zssh_steric ) 156 162 157 163 ! ! steric sea surface height 158 CALL eos( ts(:,:,:,:,Kmm), zrhd, zrhop, gdept(:,:,:,Kmm)) ! now in situ and potential density164 CALL eos( ts(:,:,:,:,Kmm), zrhd, zrhop, zgdept ) ! now in situ and potential density 159 165 zrhop(:,:,jpk) = 0._wp 160 166 CALL iom_put( 'rhop', zrhop ) … … 177 183 END IF 178 184 ! 179 zarho = glob_sum( 'diaar5', area(:,:) * zbotpres(:,:) )185 zarho = glob_sum( 'diaar5', e1e2t(:,:) * zbotpres(:,:) ) 180 186 zssh_steric = - zarho / area_tot 181 187 CALL iom_put( 'sshsteric', zssh_steric ) … … 191 197 ztsn(:,:,:,:) = 0._wp ! ztsn(:,:,1,jp_tem/sal) is used here as 2D Workspace for temperature & salinity 192 198 DO_3D_11_11( 1, jpkm1 ) 193 zztmp = area(ji,jj) * e3t(ji,jj,jk,Kmm)199 zztmp = e1e2t(ji,jj) * e3t(ji,jj,jk,Kmm) 194 200 ztsn(ji,jj,1,jp_tem) = ztsn(ji,jj,1,jp_tem) + zztmp * ts(ji,jj,jk,jp_tem,Kmm) 195 201 ztsn(ji,jj,1,jp_sal) = ztsn(ji,jj,1,jp_sal) + zztmp * ts(ji,jj,jk,jp_sal,Kmm) … … 237 243 z2d(:,:) = 0._wp 238 244 DO jk = 1, jpkm1 239 z2d(:,:) = z2d(:,:) + area(:,:) * e3t(:,:,jk,Kmm) * ztpot(:,:,jk)245 z2d(:,:) = z2d(:,:) + e1e2t(:,:) * e3t(:,:,jk,Kmm) * ztpot(:,:,jk) 240 246 END DO 241 247 ztemp = glob_sum( 'diaar5', z2d(:,:) ) … … 244 250 ! 245 251 IF( iom_use( 'ssttot' ) ) THEN ! Output potential temperature in case we use TEOS-10 246 zsst = glob_sum( 'diaar5', area(:,:) * ztpot(:,:,1) )252 zsst = glob_sum( 'diaar5', e1e2t(:,:) * ztpot(:,:,1) ) 247 253 CALL iom_put( 'ssttot', zsst / area_tot ) 248 254 ENDIF … … 259 265 ELSE 260 266 IF( iom_use('ssttot') ) THEN ! Output sst in case we use EOS-80 261 zsst = glob_sum( 'diaar5', area(:,:) * ts(:,:,1,jp_tem,Kmm) )267 zsst = glob_sum( 'diaar5', e1e2t(:,:) * ts(:,:,1,jp_tem,Kmm) ) 262 268 CALL iom_put('ssttot', zsst / area_tot ) 263 269 ENDIF … … 375 381 IF( dia_ar5_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'dia_ar5_init : unable to allocate arrays' ) 376 382 377 area(:,:) = e1e2t(:,:) 378 area_tot = glob_sum( 'diaar5', area(:,:) ) 383 area_tot = glob_sum( 'diaar5', e1e2t(:,:) ) 379 384 380 385 ALLOCATE( zvol0(jpi,jpj) ) … … 383 388 DO_3D_11_11( 1, jpkm1 ) 384 389 idep = tmask(ji,jj,jk) * e3t_0(ji,jj,jk) 385 zvol0 (ji,jj) = zvol0 (ji,jj) + idep * area(ji,jj)390 zvol0 (ji,jj) = zvol0 (ji,jj) + idep * e1e2t(ji,jj) 386 391 thick0(ji,jj) = thick0(ji,jj) + idep 387 392 END_3D
Note: See TracChangeset
for help on using the changeset viewer.