Changeset 3069
- Timestamp:
- Nov 13, 2017, 6:11:11 PM (7 years ago)
- Location:
- LMDZ6/trunk/libf
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/misc/regr_conserv_m.F90
r2788 r3069 84 84 IF(a==xt(it )) co=co+xt(it )-xs(is ) 85 85 IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1) 86 vt(it) = vt(it)+idt*(b-a)*(vs(is)+co*slope(is) )86 vt(it) = vt(it)+idt*(b-a)*(vs(is)+co*slope(is)/2.) 87 87 ELSE 88 88 vt(it) = vt(it)+idt*(b-a)* vs(is) … … 142 142 IF(a==xt(it )) co=co+xt(it )-xs(is ) 143 143 IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1) 144 IF(ix==1) vt(it,:) = vt(it,:)+idt*(b-a)*(vs(is,:)+co*slope(is,:) )145 IF(ix==2) vt(:,it) = vt(:,it)+idt*(b-a)*(vs(:,is)+co*slope(:,is) )144 IF(ix==1) vt(it,:) = vt(it,:)+idt*(b-a)*(vs(is,:)+co*slope(is,:)/2.) 145 IF(ix==2) vt(:,it) = vt(:,it)+idt*(b-a)*(vs(:,is)+co*slope(:,is)/2.) 146 146 ELSE 147 147 IF(ix==1) vt(it,:) = vt(it,:)+idt*(b-a)* vs(is,:) … … 202 202 IF(a==xt(it )) co=co+xt(it )-xs(is ) 203 203 IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1) 204 IF(ix==1) vt(it,:,:) = vt(it,:,:)+idt*(b-a)*(vs(is,:,:)+co*slope(is,:,:) )205 IF(ix==2) vt(:,it,:) = vt(:,it,:)+idt*(b-a)*(vs(:,is,:)+co*slope(:,is,:) )206 IF(ix==3) vt(:,:,it) = vt(:,:,it)+idt*(b-a)*(vs(:,:,is)+co*slope(:,:,is) )204 IF(ix==1) vt(it,:,:) = vt(it,:,:)+idt*(b-a)*(vs(is,:,:)+co*slope(is,:,:)/2.) 205 IF(ix==2) vt(:,it,:) = vt(:,it,:)+idt*(b-a)*(vs(:,is,:)+co*slope(:,is,:)/2.) 206 IF(ix==3) vt(:,:,it) = vt(:,:,it)+idt*(b-a)*(vs(:,:,is)+co*slope(:,:,is)/2.) 207 207 ELSE 208 208 IF(ix==1) vt(it,:,:) = vt(it,:,:)+idt*(b-a)* vs(is,:,:) … … 264 264 IF(a==xt(it )) co=co+xt(it )-xs(is ) 265 265 IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1) 266 IF(ix==1) vt(it,:,:,:) = vt(it,:,:,:)+idt*(b-a)*(vs(is,:,:,:)+co*slope(is,:,:,:) )267 IF(ix==2) vt(:,it,:,:) = vt(:,it,:,:)+idt*(b-a)*(vs(:,is,:,:)+co*slope(:,is,:,:) )268 IF(ix==3) vt(:,:,it,:) = vt(:,:,it,:)+idt*(b-a)*(vs(:,:,is,:)+co*slope(:,:,is,:) )269 IF(ix==4) vt(:,:,:,it) = vt(:,:,:,it)+idt*(b-a)*(vs(:,:,:,is)+co*slope(:,:,:,is) )266 IF(ix==1) vt(it,:,:,:) = vt(it,:,:,:)+idt*(b-a)*(vs(is,:,:,:)+co*slope(is,:,:,:)/2.) 267 IF(ix==2) vt(:,it,:,:) = vt(:,it,:,:)+idt*(b-a)*(vs(:,is,:,:)+co*slope(:,is,:,:)/2.) 268 IF(ix==3) vt(:,:,it,:) = vt(:,:,it,:)+idt*(b-a)*(vs(:,:,is,:)+co*slope(:,:,is,:)/2.) 269 IF(ix==4) vt(:,:,:,it) = vt(:,:,:,it)+idt*(b-a)*(vs(:,:,:,is)+co*slope(:,:,:,is)/2.) 270 270 ELSE 271 271 IF(ix==1) vt(it,:,:,:) = vt(it,:,:,:)+idt*(b-a)* vs(is,:,:,:) … … 328 328 IF(a==xt(it )) co=co+xt(it )-xs(is ) 329 329 IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1) 330 IF(ix==1) vt(it,:,:,:,:) = vt(it,:,:,:,:)+idt*(b-a)*(vs(is,:,:,:,:)+co*slope(is,:,:,:,:) )331 IF(ix==2) vt(:,it,:,:,:) = vt(:,it,:,:,:)+idt*(b-a)*(vs(:,is,:,:,:)+co*slope(:,is,:,:,:) )332 IF(ix==3) vt(:,:,it,:,:) = vt(:,:,it,:,:)+idt*(b-a)*(vs(:,:,is,:,:)+co*slope(:,:,is,:,:) )333 IF(ix==4) vt(:,:,:,it,:) = vt(:,:,:,it,:)+idt*(b-a)*(vs(:,:,:,is,:)+co*slope(:,:,:,is,:) )334 IF(ix==5) vt(:,:,:,:,it) = vt(:,:,:,:,it)+idt*(b-a)*(vs(:,:,:,:,is)+co*slope(:,:,:,:,is) )330 IF(ix==1) vt(it,:,:,:,:) = vt(it,:,:,:,:)+idt*(b-a)*(vs(is,:,:,:,:)+co*slope(is,:,:,:,:)/2.) 331 IF(ix==2) vt(:,it,:,:,:) = vt(:,it,:,:,:)+idt*(b-a)*(vs(:,is,:,:,:)+co*slope(:,is,:,:,:)/2.) 332 IF(ix==3) vt(:,:,it,:,:) = vt(:,:,it,:,:)+idt*(b-a)*(vs(:,:,is,:,:)+co*slope(:,:,is,:,:)/2.) 333 IF(ix==4) vt(:,:,:,it,:) = vt(:,:,:,it,:)+idt*(b-a)*(vs(:,:,:,is,:)+co*slope(:,:,:,is,:)/2.) 334 IF(ix==5) vt(:,:,:,:,it) = vt(:,:,:,:,it)+idt*(b-a)*(vs(:,:,:,:,is)+co*slope(:,:,:,:,is)/2.) 335 335 ELSE 336 336 IF(ix==1) vt(it,:,:,:,:) = vt(it,:,:,:,:)+idt*(b-a)* vs(is,:,:,:,:) -
LMDZ6/trunk/libf/phylmd/regr_pr_time_av_m.F90
r2981 r3069 5 5 USE mod_phys_lmdz_transfert_para, ONLY: bcast 6 6 USE mod_phys_lmdz_para, ONLY: mpi_rank, omp_rank 7 USE print_control_mod, ONLY: prt_level 7 8 IMPLICIT NONE 8 9 … … 86 87 LOGICAL, SAVE :: lfirst=.TRUE. !--- First call flag 87 88 !$OMP THREADPRIVATE(lfirst) 88 REAL, PARAMETER :: pTropUp= 5.E+3 !--- Value <tropopause pressure (Pa)89 REAL, PARAMETER :: pTropUp=9.E+3 !--- Value < tropopause pressure (Pa) 89 90 REAL, PARAMETER :: gamm = 0.4 !--- Relative thickness of transitions 90 91 REAL, PARAMETER :: rho = 1.3 !--- Max tropopauses sigma ratio 91 92 REAL, PARAMETER :: o3t0 = 1.E-7 !--- Nominal O3 vmr at tropopause 92 93 LOGICAL, PARAMETER :: lo3tp=.FALSE. !--- Use parametrized O3 vmr at tropopause 94 LOGICAL, PARAMETER :: debug=.FALSE. !--- Force writefield_phy multiple outputs 95 REAL, PARAMETER :: ChemPTrMin=9.E+3 !--- Thresholds for minimum and maximum 96 REAL, PARAMETER :: ChemPTrMax=4.E+4 ! chemical tropopause pressure (Pa). 97 REAL, PARAMETER :: DynPTrMin =8.E+3 !--- Thresholds for minimum and maximum 98 REAL, PARAMETER :: DynPTrMax =4.E+4 ! dynamical tropopause pressure (Pa). 93 99 94 100 CONTAINS … … 117 123 !------------------------------------------------------------------------------- 118 124 ! Arguments: 119 INTEGER, INTENT(IN) :: fID !--- NetCDF file ID125 INTEGER, INTENT(IN) :: fID !--- NetCDF file ID 120 126 CHARACTER(LEN=13), INTENT(IN) :: nam(:) !--- NetCDF variables names 121 REAL, INTENT(IN) :: julien !--- Days since Jan 1st 122 REAL, INTENT(IN) :: pint_in(:) !--- Interfaces file Pres, Pa, ascending 123 REAL, INTENT(IN) :: pint_ou(:,:) !--- Interfaces LMDZ pressure, Pa (g,nbp_lev+1) 124 REAL, INTENT(OUT) :: v3(:,:,:) !--- Regridded field (klon,llm,SIZE(nam)) 127 REAL, INTENT(IN) :: julien !--- Days since Jan 1st 128 !--- File & LMDZ (resp. decreasing & increasing order) interfaces pressure, Pa 129 REAL, INTENT(IN) :: pint_in(:) !--- in: file (nlev_in+1) 130 REAL, INTENT(IN) :: pint_ou(:,:) !--- out: LMDZ (klon,nbp_lev+1) 131 REAL, INTENT(OUT) :: v3(:,:,:) !--- Regridded fld (klon,llm,n_var) 125 132 REAL, INTENT(IN), OPTIONAL :: time_in(:) !--- Records times, in days 126 133 ! since Jan 1 of current year 127 REAL, INTENT(IN), OPTIONAL :: lon_in(:) !--- Input/output longitudes vector128 REAL, INTENT(IN), OPTIONAL :: lat_in(:) !--- Input/output latitudes vector129 REAL, INTENT(IN), OPTIONAL :: pcen_in(:) !--- Mid-layers file pressure130 REAL, INTENT(IN), OPTIONAL :: ptrop_ou(:)!--- Output tropopause pres(klon)134 REAL, INTENT(IN), OPTIONAL :: lon_in(:) !--- File longitudes vector (klon) 135 REAL, INTENT(IN), OPTIONAL :: lat_in(:) !--- File latitudes vector (klon) 136 REAL, INTENT(IN), OPTIONAL :: pcen_in(:) !--- File mid-layers pres (nlev_in) 137 REAL, INTENT(IN), OPTIONAL :: ptrop_ou(:)!--- LMDZ tropopause pres (klon) 131 138 !------------------------------------------------------------------------------- 132 139 ! Local variables: … … 158 165 REAL, DIMENSION(klon) :: ps2, pt2, ot2, ptropou 159 166 LOGICAL :: ll 167 !--- For debug 168 REAL, DIMENSION(klon) :: ptrop_in, ptrop_ef!, dzStrain, dzStrain0 169 ! REAL, DIMENSION(klon,nbp_lev+1) :: pstrn_ou, phii 160 170 !------------------------------------------------------------------------------- 161 171 sub="regr_pr_time_av" … … 254 264 Sig_ou(:) = [pintou (1:nbp_lev)/ps2(i),1.0] !--- increasing values 255 265 256 !--- INPUT (FILE) AND OUTPUT (LMDZ) SIGMA LEVELS AT TROPOPAUSE 266 !--- INPUT (FILE) SIGMA LEVEL AT TROPOPAUSE ; extreme values are filtered 267 ! to keep tropopause pressure realistic ; high values are usually due to 268 ! ozone hole fooling the crude chemical tropopause detection algorithm. 257 269 SigT_in = get_SigTrop(i,itrp) 270 SigT_in=MIN(SigT_in,ChemPTrMax/ps2(i)) !--- too low value filtered 271 SigT_in=MAX(SigT_in,ChemPTrMin/ps2(i)) !--- too high value filtered 272 273 !--- OUTPUT (LMDZ) SIGMA LEVEL AT TROPOPAUSE ; too high variations of the 274 ! dynamical tropopause (especially in filaments) are conterbalanced with a 275 ! filter ensuring it stays within a certain distance around input (file) 276 ! tropopause, hence avoiding avoid a too thick stretched region ; a final 277 ! extra-safety filter keeps the tropopause pressure value realistic. 258 278 SigT_ou = ptrop_ou(i)/ps2(i) 259 260 !--- AVOID THE FILAMENTS WHICH WOULD NEED A VERY THICK STRETCHED REGION261 IF(SigT_ou>SigT_in*rho) SigT_ou = SigT_in*rho262 IF(SigT_ou<SigT_in/rho) SigT_ou = SigT_in/rho279 IF(SigT_ou<SigT_in/rho) SigT_ou=SigT_in/rho !--- too low value w/r input 280 IF(SigT_ou>SigT_in*rho) SigT_ou=SigT_in*rho !--- too high value w/r input 281 SigT_ou=MIN(SigT_ou,DynPTrMax/ps2(i)) !--- too low value filtered 282 SigT_ou=MAX(SigT_ou,DynPTrMin/ps2(i)) !--- too high value filtered 263 283 ptropou(i)=SigT_ou*ps2(i) 264 284 265 !--- STRETCHING EXPONENT INCREMENT FOR SIMPLE POWER LAW285 !--- FULLY STRETCHED LAYER BOUNDS (alpha power law fully applied) 266 286 alpha = LOG(SigT_in/SigT_ou)/LOG(SigT_ou) 267 268 !--- FULLY STRETCHED LAYER BOUNDS (FILE AND MODEL TROPOPAUSES)269 287 Sig_bot = MAX(SigT_in,SigT_ou) ; ibot = locate(Sig_ou(:),Sig_bot) 270 288 Sig_top = MIN(SigT_in,SigT_ou) ; itop = locate(Sig_ou(:),Sig_top) 271 289 272 !--- PARTIALLY STRETCHED LAYER BOUNDS, ENSURING >0 DERIVATIVE 290 !--- PARTIALLY STRETCHED LAYER BOUNDS (fraction of alpha applied) 291 ! The used formulae ensure the first derivative stays positive. 273 292 beta = LOG(Sig_top)/LOG(Sig_bot) 274 293 Sig_bo0 = Sig_bot ; IF(alpha<0.) Sig_bo0 = Sig_bot**(1/beta) … … 282 301 ito0 = locate(Sig_ou(:),Sig_to0) 283 302 284 !--- FUNCTION FOR STRETCHING LOCALISATION 285 ! 0 < Sig_to0 < Sig_top <= Sig_bo0 < Sig_bot < 1 303 !--- STRETCHING POWER LAW FUNCTION: 304 ! 0 in [0,Sig_to0] and [Sig_bo0,1] ; 1 in [Sig_bot,Sig_top] 305 ! 0->1 in [Sig_to0,Sig_top] 1->0 in [Sig_bot,Sig_bo0] 286 306 phi(:)=0. 287 307 phi(itop+1:ibot) = 1. … … 291 311 *LOG(Sig_bot)/LOG(Sig_bot/Sig_bo0) 292 312 293 !--- LOCAL STRAINED OUTPUT (LMDZ) PRESSURE PROFILES (INCREASING ORDER)313 !--- LOCALY STRECHED OUTPUT (LMDZ) PRESSURE PROFILES (INCREASING ORDER) 294 314 pstr_ou(:) = pintou(:) * Sig_ou(:)**(alpha*phi(:)) 295 315 … … 307 327 ! IF(ll) CALL abort_physic(sub, 'Inconsistent O3 values in stratosphere', 1) 308 328 329 IF(debug) THEN 330 ! dzStrain0(i)=7.*LOG(Sig_bo0/Sig_to0) 331 ! dzStrain (i)=7.*LOG(Sig_bot/Sig_top) 332 ptrop_in(i) = SigT_in*ps2(i) 333 ! Pstrn_ou(i,:)= pstr_ou 334 ! phii(i,:)=phi(:) 335 ptrop_ef(i)=chem_tropopause(i, itrp, locate(pintou(:),PTropUp), & 336 pintou(:), v3(:,nbp_lev+1:1:-1,1),o3trop=o3t0) 337 END IF 309 338 END DO 339 IF(debug) THEN 340 ! CALL writefield_phy('PreSt_ou' ,Pstrn_ou,nbp_lev+1) !--- Strained pressure 341 ! CALL writefield_phy('dzStrain' ,dzStrain ,1) !--- Fully & total strained 342 ! CALL writefield_phy('dzStrain0',dzStrain0,1) !--- regions thickness 343 ! CALL writefield_phy('phi',phii,nbp_lev+1) !--- Localisation function 344 !--- Tropopauses pressures: 345 CALL writefield_phy('PreTr_in',ptrop_in,1) !--- Input and effective 346 CALL writefield_phy('PreTr_ef',ptrop_ef,1) ! chemical tropopauses 347 END IF 348 END IF 349 IF(debug) THEN 350 IF(lAdjTro) & 351 CALL writefield_phy('PreTr_ou',ptropou,1) !--- LMDz dyn tropopause 352 CALL writefield_phy('Ozone_in',v2(:,:,1),nlev_in)!--- Raw input O3 field 353 CALL writefield_phy('Ozone_ou',v3(:,:,1),nbp_lev)!--- Output ozone field 354 CALL writefield_phy('Pint_ou' ,pint_ou,1+nbp_lev)!--- LMDZ unstreched Press 310 355 END IF 311 356 … … 548 593 lmax=.FALSE.; IF(PRESENT(vmax)) lmax=COUNT(o3col>vmax)/=0 549 594 check_ozone=lmin.OR.lmax; IF(.NOT.check_ozone) RETURN 595 IF(prt_level<1) RETURN 550 596 551 597 !--- SOME TOO LOW VALUES FOUND
Note: See TracChangeset
for help on using the changeset viewer.