Changeset 4243 for dynamico_lmdz
- Timestamp:
- Jun 10, 2020, 1:40:47 PM (4 years ago)
- Location:
- dynamico_lmdz/simple_physics
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/simple_physics/config/DYNAMICO/TEST/field_def_physics.xml
r4242 r4243 29 29 <field id="phyparam_plev" /> 30 30 31 <field id="phyparam_du" name="du" long_name="Zonal velocity tendency" unit="m/s2" />32 <field id="phyparam_dv" name="dv" long_name="Meridional velocity tendency" unit="m/s2" />33 <field id="phyparam_dt" name="dT" long_name="Temperature tendency" unit="K/s" />31 <field id="phyparam_du" name="du" long_name="Zonal velocity tendency" unit="m/s2" /> 32 <field id="phyparam_dv" name="dv" long_name="Meridional velocity tendency" unit="m/s2" /> 33 <field id="phyparam_dt" name="dT" long_name="Temperature tendency" unit="K/s" /> 34 34 <field id="phyparam_dtsw" name="dT_SW" long_name="Temperature tendency due to shortwave radiation" unit="K/s" /> 35 35 <field id="phyparam_dtlw" name="dT_LW" long_name="Temperature tendency due to longwave radiation" unit="K/s" /> … … 38 38 <field_group axis_ref="levp1"> 39 39 <field id="phyparam_swflux_down" name="swflux_down" long_name="Downward SW radiative flux" unit="W/m2" /> 40 <field id="phyparam_swflux_up" name="swflux_up" long_name="Upward SW radiative flux" unit="W/m2" /> 40 41 </field_group> 41 42 -
dynamico_lmdz/simple_physics/config/DYNAMICO/TEST/file_def_physics.xml
r4242 r4243 19 19 <field field_ref="phyparam_dtlw" /> 20 20 <field field_ref="phyparam_swflux_down" /> 21 <field field_ref="phyparam_swflux_up" /> 21 22 22 23 </field_group> -
dynamico_lmdz/simple_physics/config/DYNAMICO/build_DYNAMICO.sh
r4232 r4243 14 14 cd ../DYNAMICO 15 15 ./make_icosa -arch $ARCH -parallel mpi -with_xios -job 8 16 #./make_icosa -arch $ARCH -parallel mpi -with_xios -job 8 -debug 16 17 17 18 cd ../DYNAMICO_phyparam -
dynamico_lmdz/simple_physics/config/DYNAMICO/modeles/DYNAMICO_phyparam/make_dynamico_phyparam
r4232 r4243 28 28 # compile in production mode 29 29 COMPIL_FFLAGS="%PROD_FFLAGS $COMPIL_FFLAGS" 30 # or in debug mode 31 #COMPIL_FFLAGS="%DEBUG_FFLAGS $COMPIL_FFLAGS" 30 32 31 33 rm -f config.fcm -
dynamico_lmdz/simple_physics/phyparam/physics/radiative_sw.F90
r4242 r4243 12 12 CONTAINS 13 13 14 PURE SUBROUTINE monGATHER(n ,a,b,index)15 INTEGER, INTENT(IN) :: n,index(n)16 REAL, INTENT(IN) :: b(n)17 REAL, INTENT(OUT) :: a(n)14 PURE SUBROUTINE monGATHER(ngrid, n,index, a,b) 15 INTEGER, INTENT(IN) :: ngrid, n, index(n) 16 REAL, INTENT(IN) :: a(ngrid) 17 REAL, INTENT(OUT) :: b(n) 18 18 INTEGER :: i 19 20 DO i=1,n 21 a(i)=b(index(i)) 22 END DO 19 IF(n<ngrid) THEN 20 DO i=1,n 21 b(i)=a(index(i)) 22 END DO 23 ELSE 24 b(:)=a(:) 25 END IF 23 26 END SUBROUTINE monGATHER 24 27 25 PURE subroutine monscatter(ngrid, n, a,index,b)28 PURE subroutine monscatter(ngrid, n,index, b,a) 26 29 INTEGER, INTENT(IN) :: ngrid, n,index(n) 27 30 REAL, INTENT(IN) :: b(n) … … 47 50 ! 48 51 ! Rayonnement solaire en atmosphere non diffusante avec un 49 ! coefficient d abso prption gris.52 ! coefficient d absorption gris. 50 53 ! 51 54 !======================================================================= 52 ! 53 ! declarations: 54 ! ------------- 55 ! 56 ! 57 ! arguments: 58 ! ---------- 59 ! 60 INTEGER, INTENT(IN) :: ngrid,nlayer 55 56 INTEGER, INTENT(IN) :: ngrid, nlayer 61 57 LOGICAL, INTENT(IN) :: ldiurn, lverbose, lwrite 62 REAL, INTENT(IN) :: albedo(ngrid), coefvis63 REAL, INTENT(IN) :: pmu(ngrid), pfract(ngrid)64 REAL, INTENT(IN) :: plevel(ngrid,nlayer+1),ps_rad65 REAL, INTENT(IN) :: psolarf066 REAL, INTENT(OUT) :: fsrfvis(ngrid),dtsw(ngrid,nlayer)67 68 REAL zalb(ngrid),zmu(ngrid),zfract(ngrid)69 REAL zplev(ngrid,nlayer+1)70 REAL zflux(ngrid),zdtsw(ngrid,nlayer)71 72 INTEGER ig,l,nlevel,index(ngrid),ncount,igout 73 REAL ztrdir(ngrid,nlayer+1), & ! transmission coef for downward flux74 ztrref(ngrid,nlayer+1) ! transmission coef for upward flux75 REAL zfsrfref(ngrid) ! upward flux at surface76 REAL z1(ngrid)77 REAL zu(ngrid,nlayer+1)78 REAL tau079 80 REAL :: flux_in(ngrid), & ! incoming solar flux81 & flux_ ref(ngrid), & ! flux reflected by surface58 REAL, INTENT(IN) :: & 59 psolarf0, & ! solar constant 60 ps_rad, coefvis, & ! coefvis = attenuation at p=ps_rad 61 albedo(ngrid), & ! albedo 62 pmu(ngrid), & ! cosine zenithal angle 63 pfract(ngrid), & ! day fraction 64 plevel(ngrid,nlayer+1) ! pressure at interfaces 65 REAL, INTENT(OUT) :: & 66 fsrfvis(ngrid), & ! net surface flux 67 dtsw(ngrid,nlayer) ! temperature tendency 68 69 REAL :: buf1(ngrid), buf2(ngrid, nlayer+1) ! buffers for output 70 ! fluxes are non-zero only on those points where the sun shines (mu0>0) 71 ! We compute only on those ncount points and gather them to vectorize 72 INTEGER :: ncount, index(ngrid) 73 ! In the work arrays below, ngrid should be ncount but ncount is not known yet 74 REAL :: zalb(ngrid), & ! albedo 75 & zmu(ngrid), & ! cosine zenithal angle 76 & zfract(ngrid), & ! day fraction 77 & flux_in(ngrid), & ! incoming solar flux 82 78 & flux_down(ngrid, nlayer+1), & ! downward flux 83 & flux_up(ngrid, nlayer+1) ! upward flux 84 REAL :: buf1(ngrid), buf2(ngrid, nlayer+1) ! buffers for output 85 86 !----------------------------------------------------------------------- 87 ! 1. initialisations: 88 ! ------------------- 79 & flux_up(ngrid, nlayer+1), & ! upward flux 80 & zplev(ngrid,nlayer+1), & ! pressure at interfaces 81 & zflux(ngrid), & ! net surface flux 82 & zdtsw(ngrid,nlayer), & ! temperature tendency 83 & zu(ngrid,nlayer+1) 84 INTEGER :: ig,l,nlevel,igout 85 REAL :: tau0 89 86 90 87 nlevel=nlayer+1 … … 105 102 ENDIF 106 103 ENDDO 107 CALL monGATHER(ncount,zfract,pfract,index)108 CALL monGATHER(ncount,zmu,pmu,index)109 CALL monGATHER(ncount,zalb,albedo,index)110 DO l=1,nlevel111 CALL monGATHER(ncount,zplev(1,l),plevel(1,l),index)112 ENDDO113 104 ELSE 114 105 ncount=ngrid 115 zfract(:)=pfract(:) 116 zmu(:)=pmu(:) 117 zalb(:)=albedo(:) 118 zplev(:,:)=plevel(:,:) 119 ENDIF 106 ENDIF 107 108 igout=ncount/2+1 109 CALL monGATHER(ngrid,ncount,index, pfract,zfract) 110 CALL monGATHER(ngrid,ncount,index, pmu, zmu) 111 CALL monGATHER(ngrid,ncount,index, albedo,zalb) 112 DO l=1,nlevel 113 CALL monGATHER(ngrid,ncount,index, plevel(:,l),zplev(:,l)) 114 ENDDO 120 115 121 116 !----------------------------------------------------------------------- … … 123 118 ! ---------------------------------------------------- 124 119 125 tau0=-.5*log(coefvis)126 127 120 ! calcul de la partie homogene de l opacite 128 tau0= tau0/ps_rad121 tau0=-.5*log(coefvis)/ps_rad 129 122 DO l=1,nlayer+1 130 123 DO ig=1,ncount … … 143 136 DO l=1,nlevel 144 137 DO ig=1,ncount 145 ztrdir(ig,l)=exp(-zu(ig,l)/zmu(ig)) ! transmission coefficient 146 flux_down(ig,l) = flux_in(ig)*ztrdir(ig,l) 147 ENDDO 148 ENDDO 149 150 IF (lverbose) THEN 151 igout=ncount/2+1 152 WRITELOG(*,*) 138 flux_down(ig,l) = flux_in(ig)*exp(-zu(ig,l)/zmu(ig)) 139 ENDDO 140 ENDDO 141 142 IF (lverbose) THEN 153 143 WRITELOG(*,*) 'Diagnostique des transmission dans le spectre solaire' 154 144 WRITELOG(*,*) 'zfract, zmu, zalb' … … 156 146 WRITELOG(*,*) 'Pression, quantite d abs, transmission' 157 147 DO l=1,nlayer+1 158 WRITELOG(*,*) zplev(igout,l),zu(igout,l),ztrdir(igout,l) 159 ENDDO 160 ENDIF 148 WRITELOG(*,*) zplev(igout,l),zu(igout,l),flux_down(igout,l)/flux_in(igout) 149 ENDDO 150 LOG_INFO('rad_sw') 151 ENDIF 152 153 !----------------------------------------------------------------------- 154 ! 4. calcul du flux solaire arrivant sur le sol: 155 ! ---------------------------------------------- 156 157 DO ig=1,ncount 158 zflux(ig) = (1.-zalb(ig))*flux_down(ig,1) ! absorbed (net) 159 flux_up(ig,1) = zalb(ig)*flux_down(ig,1) ! reflected (up) 160 ENDDO 161 IF (lverbose) THEN 162 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires:' 163 WRITELOG(*,*) ' 2 flux solaire net incident sur le sol' 164 WRITELOG(*,*) zflux(igout) 165 LOG_INFO('rad_sw') 166 ENDIF 167 168 !----------------------------------------------------------------------- 169 ! 5.calcul des transmissions depuis le sol, cas diffus: 170 ! ------------------------------------------------------ 171 172 DO l=1,nlevel 173 DO ig=1,ncount 174 flux_up(ig,l)=flux_up(ig,1)*exp(-(zu(ig,1)-zu(ig,l))*1.66) 175 ENDDO 176 ENDDO 177 178 IF (lverbose) THEN 179 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires' 180 WRITELOG(*,*) ' 3 transmission avec les sol' 181 WRITELOG(*,*) 'niveau transmission' 182 DO l=1,nlevel 183 WRITELOG(*,*) l, flux_up(igout,l)/flux_up(igout,1) 184 ENDDO 185 LOG_INFO('rad_sw') 186 ENDIF 187 188 !----------------------------------------------------------------------- 189 ! 10. sorties eventuelles: 190 ! ------------------------ 191 192 IF(lwrite) THEN 193 CALL monscatter(ngrid,ncount,index, flux_in,buf1) 194 CALL writefield('swtop','SW down TOA','W/m2',buf1) 195 196 DO l=1,nlevel 197 CALL monscatter(ngrid,ncount,index, flux_down(:,l),buf2(:,l)) 198 ENDDO 199 CALL writefield('swflux_down','Downward SW flux','W/m2',buf2) 200 201 DO l=1,nlevel 202 CALL monscatter(ngrid,ncount,index, flux_up(:,l),buf2(:,l)) 203 ENDDO 204 CALL writefield('swflux_up','Upward SW flux','W/m2',buf2) 205 206 END IF 161 207 162 208 !----------------------------------------------------------------------- … … 168 214 ! m.cp.dT = dflux/dz 169 215 ! m = -(dp/dz)/g 170 ! flux = ztrdir * psolarf0*zfract*zmu 171 IF(.FALSE.) THEN 172 zdtsw(ig,l)=g*psolarf0*zfract(ig)*zmu(ig) & 173 & *(ztrdir(ig,l+1)-ztrdir(ig,l)) & 174 & /(cpp*(zplev(ig,l)-zplev(ig,l+1))) 175 ELSE 176 zdtsw(ig,l)=(g/cpp) & 177 & * (flux_down(ig,l+1)-flux_down(ig,l)) & 178 & / (zplev(ig,l)-zplev(ig,l+1)) 179 END IF 180 ENDDO 181 ENDDO 182 IF (lverbose) THEN 183 WRITELOG(*,*) 216 zdtsw(ig,l)=(g/cpp) & 217 & * (flux_down(ig,l+1)-flux_down(ig,l)) & 218 & / (zplev(ig,l)-zplev(ig,l+1)) 219 ENDDO 220 ENDDO 221 222 IF (lverbose) THEN 184 223 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires:' 185 224 WRITELOG(*,*) ' 1 taux de chauffage lie au ray. solaire direct' … … 187 226 WRITELOG(*,*) zdtsw(igout,l) 188 227 ENDDO 189 ENDIF 190 191 192 !----------------------------------------------------------------------- 193 ! 4. calcul du flux solaire arrivant sur le sol: 194 ! ---------------------------------------------- 195 196 DO ig=1,ncount 197 z1(ig)=zfract(ig)*zmu(ig)*psolarf0*ztrdir(ig,1) ! total (down) 198 zflux(ig)=(1.-zalb(ig))*z1(ig) ! absorbed (net) 199 zfsrfref(ig)= zalb(ig)*z1(ig) ! reflected (up) 200 ENDDO 201 IF (lverbose) THEN 202 WRITELOG(*,*) 203 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires:' 204 WRITELOG(*,*) ' 2 flux solaire net incident sur le sol' 205 WRITELOG(*,*) zflux(igout) 206 ENDIF 207 208 209 !----------------------------------------------------------------------- 210 ! 5.calcul des transmissions depuis le sol, cas diffus: 211 ! ------------------------------------------------------ 212 213 DO l=1,nlevel 214 DO ig=1,ncount 215 ztrref(ig,l)=exp(-(zu(ig,1)-zu(ig,l))*1.66) 216 ENDDO 217 ENDDO 218 219 IF (lverbose) THEN 220 WRITELOG(*,*) 221 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires' 222 WRITELOG(*,*) ' 3 transmission avec les sol' 223 WRITELOG(*,*) 'niveau transmission' 224 DO l=1,nlevel 225 WRITELOG(*,*) l,ztrref(igout,l) 226 ENDDO 228 LOG_INFO('rad_sw') 227 229 ENDIF 228 230 … … 234 236 DO ig=1,ncount 235 237 zdtsw(ig,l)=zdtsw(ig,l)+ & 236 g*zfsrfref(ig)*(ztrref(ig,l+1)-ztrref(ig,l))/ & 237 (cpp*(zplev(ig,l+1)-zplev(ig,l))) 238 ENDDO 239 ENDDO 240 241 !----------------------------------------------------------------------- 242 ! 10. sorties eventuelles: 243 ! ------------------------ 244 245 IF (lverbose) THEN 246 WRITELOG(*,*) 238 (g/cpp)*(flux_up(ig,l)-flux_up(ig,l+1)) & 239 /(zplev(ig,l)-zplev(ig,l+1)) 240 ENDDO 241 ENDDO 242 243 IF (lverbose) THEN 247 244 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires:' 248 245 WRITELOG(*,*) ' 3 taux de chauffage total' … … 250 247 WRITELOG(*,*) zdtsw(igout,l) 251 248 ENDDO 252 ENDIF 253 254 CALL monscatter(ngrid,ncount,fsrfvis,index,zflux) 249 LOG_INFO('rad_sw') 250 ENDIF 251 252 CALL monscatter(ngrid,ncount,index, zflux,fsrfvis) 255 253 DO l=1,nlayer 256 CALL monscatter(ngrid,ncount,dtsw(:,l),index,zdtsw(:,l)) 257 ENDDO 258 259 IF(lwrite) THEN 260 CALL monscatter(ngrid, ncount,buf1,index,flux_in) 261 CALL writefield('swtop','SW down TOA','W/m2',buf1) 262 263 DO l=1,nlayer+1 264 CALL monscatter(ngrid,ncount,buf2(:,l),index,flux_down(:,l)) 265 ENDDO 266 CALL writefield('swflux_down','Downwards SW flux','W/m2',buf2) 267 268 END IF 269 270 LOG_INFO('rad_sw') 254 CALL monscatter(ngrid,ncount,index, zdtsw(:,l),dtsw(:,l)) 255 ENDDO 271 256 272 257 END SUBROUTINE sw
Note: See TracChangeset
for help on using the changeset viewer.