Changeset 2819
- Timestamp:
- Mar 8, 2017, 3:34:12 PM (8 years ago)
- Location:
- LMDZ5/trunk/libf/phylmd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/physiq_mod.F90
r2812 r2819 1021 1021 = ["tro3 ","tro3_daylight"] 1022 1022 ! vars_climoz(1:read_climoz): variables names in climoz file. 1023 ! vars_climoz(1:read_climoz-2) if read_climoz>2 (temporary) 1024 REAL :: ro3i ! 0<=ro3i<=360 ; required time index in NetCDF file for 1025 ! the ozone fields, old method. 1023 1026 1024 1027 include "YOMCST.h" … … 1972 1975 1973 1976 wo(:,:,1)=ozonecm(latitude_deg, paprs,read_climoz,rjour=zzz) 1977 ELSE IF(ANY([1,2]==read_climoz)) THEN 1978 ro3i = REAL(INT((days_elapsed+jh_cur-jh_1jan)/year_len*360.)) 1979 IF(INT(ro3i) == 360) ro3i = 359. 1980 ! (This should never occur, except perhaps because of roundup 1981 ! error. See documentation.) 1982 WRITE(*,*)' >> Using 360 records ozone files (old method).' 1983 CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz), & 1984 ro3i+1., press_edg_climoz, paprs, wo) 1985 FORALL (l = 1: read_climoz) wo(:, :, l) = wo(:, :, l) * rmo3 / rmd & 1986 * zmasse / dobson_u / 1e3 1974 1987 ELSE 1975 1988 IF(adjust_tropopause) THEN … … 1977 1990 CALL dyn_tropopause(t_seri, ztsol, paprs, pplay, presnivs, rot, & 1978 1991 pr_tropopause) 1979 CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz ),&1992 CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz-2), & 1980 1993 days_elapsed+jh_cur-jh_1jan, press_edg_climoz, paprs, wo, & 1981 1994 time_climoz, latitude_deg, press_cen_climoz, pr_tropopause) 1982 1995 ELSE 1983 1996 WRITE(*,*)' >> Interpolating O3 field directly on gcm levels.' 1984 CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz ),&1997 CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz-2), & 1985 1998 days_elapsed+jh_cur-jh_1jan, press_edg_climoz, paprs, wo, & 1986 1999 time_climoz) -
LMDZ5/trunk/libf/phylmd/regr_pr_time_av_m.F90
r2788 r2819 71 71 LOGICAL, SAVE :: lO3Trop !--- Tropopause ozone flag 72 72 LOGICAL, SAVE :: lfirst=.TRUE. !--- First call flag 73 !$OMP THREADPRIVATE(lfirst) 73 74 REAL, PARAMETER :: co3(3)=[91.,28.,20.] !--- Coeffs for o3 threshold 74 75 REAL, PARAMETER :: prtrop=5.E+3 !--- Value lower than the tropopause pressure … … 79 80 !------------------------------------------------------------------------------- 80 81 ! 81 SUBROUTINE regr_pr_time_av(fID, nam, julien, pint_in, p cen_ou, v3, time_in, &82 SUBROUTINE regr_pr_time_av(fID, nam, julien, pint_in, pint_ou, v3, time_in, & 82 83 lat_in, pcen_in, ptrop_ou) 83 84 ! … … 102 103 CHARACTER(LEN=13), INTENT(IN) :: nam(:) !--- NetCDF variables names 103 104 REAL, INTENT(IN) :: julien !--- Days since Jan 1st 104 REAL, INTENT(IN) :: pint_in(:) !--- Interfaces Pressure, Pa, ascending105 REAL, INTENT(IN) :: p cen_ou(:,:) !--- Mid-layers LMDZ Pres, Pa (klon,llm+1)105 REAL, INTENT(IN) :: pint_in(:) !--- Interfaces file Pres, Pa, ascending 106 REAL, INTENT(IN) :: pint_ou(:,:) !--- Interfaces LMDZ Pres, Pa (klon,llm+1) 106 107 REAL, INTENT(OUT) :: v3(:,:,:) !--- Regridded field (klon,llm,SIZE(nam)) 107 108 REAL, INTENT(IN), OPTIONAL :: time_in(:) !--- Records times, in days 108 109 ! since Jan 1 of current year 109 110 REAL, INTENT(IN), OPTIONAL :: lat_in(:) !--- Input/output latitudes vector 110 REAL, INTENT(IN), OPTIONAL :: pcen_in(:) !--- Mid-layers pressure111 REAL, INTENT(IN), OPTIONAL :: pcen_in(:) !--- Mid-layers file pressure 111 112 REAL, INTENT(IN), OPTIONAL :: ptrop_ou(:)!--- Output tropopause pressure (klon) 112 113 !------------------------------------------------------------------------------- … … 136 137 !------------------------------------------------------------------------------- 137 138 sub="regr_pr_time_av" 139 nlev_in=SIZE(pint_in)-1 138 140 CALL assert(SIZE(v3,1)==klon, TRIM(sub)//" v3 klon") 139 141 CALL assert(SIZE(v3,2)==nbp_lev, TRIM(sub)//" v3 nbp_lev") 140 142 n_var = assert_eq(SIZE(nam), SIZE(v3,3), TRIM(sub)//" v3 n_var") 141 CALL assert(SHAPE(p cen_ou)==[klon, nbp_lev+1],TRIM(sub)//" pcen_ou")143 CALL assert(SHAPE(pint_ou)==[klon, nbp_lev+1],TRIM(sub)//" pint_ou") 142 144 IF(PRESENT(lat_in)) CALL assert(SIZE(lat_in )==klon,TRIM(sub)//" lat_in klon") 143 145 IF(PRESENT(ptrop_ou)) CALL assert(SIZE(ptrop_ou)==klon,TRIM(sub)//" ptrop_ou klon") 146 IF(PRESENT(pcen_in)) CALL assert(SIZE(pcen_in)==nlev_in,TRIM(sub)//" pcen_in") 144 147 ltrop=PRESENT(lat_in).AND.PRESENT(pcen_in).AND.PRESENT(ptrop_ou) 145 nlev_in=SIZE(pint_in)-1146 148 147 149 !$OMP MASTER … … 162 164 IF(lO3Trop) ALLOCATE(otm(nbp_lon,nbp_lat),otp(nbp_lon,nbp_lat)) 163 165 END IF 164 IF(PRESENT(pcen_in)) itrp0=locate(pcen_in,prtrop) !--- Above tropopause: 50hPa 166 !--- INITIAL INDEX: LOCATE A LAYER WELL ABOVE TROPOPAUSE (50hPa) 167 IF(PRESENT(pcen_in)) THEN 168 itrp0=locate(pcen_in,prtrop) 169 ELSE 170 itrp0=locate(SQRT(pint_in(1:nlev_in)*pint_in(2:nlev_in+1)),prtrop) 171 END IF 165 172 IF(lPrSurf) WRITE(*,*)' >> Using GROUND PRESSURE from input O3 forcing file.' 166 173 IF(linterp) WRITE(*,*)' >> Monthly O3 files => ONLINE TIME INTERPOLATION.' … … 178 185 !=== TIME INTERPOLATION FOR MONTHLY INPUT FILES 179 186 IF(linterp) THEN 180 WRITE(*,'(3(a,f7.3))')' >> Interpolating O3 at julian day ',julien, ' fr&181 & om forcing fields at times ',time_in(irec),' and ', time_in(irec+1)187 WRITE(*,'(3(a,f7.3))')' >> Interpolating O3 at julian day ',julien, & 188 &' from forcing fields at times ',time_in(irec),' and ', time_in(irec+1) 182 189 al=(time_in(irec+1)-julien)/(time_in(irec+1)-time_in(irec)) 183 190 v1=al*v1m+(1.-al)*v1p … … 188 195 END IF 189 196 !$OMP END MASTER 190 !$OMP BARRIER191 197 CALL scatter2d(v1,v2) 192 IF(PRESENT(pcen_in))CALL bcast(itrp0)193 !--- "ps" not in input file => assume it is equal to current LMDZ value194 IF(lPrSurf) THEN; CALL scatter2d(ps1,ps2); ELSE; ps2= pcen_ou(:,1); END IF198 CALL bcast(itrp0) 199 !--- No "ps" in input file => assumed to be equal to current LMDZ ground press 200 IF(lPrSurf) THEN; CALL scatter2d(ps1,ps2); ELSE; ps2=Pint_ou(:,1); END IF 195 201 IF(lPrTrop) CALL scatter2d(pt1,pt2) 196 202 IF(lO3Trop) CALL scatter2d(ot1,ot2) … … 199 205 IF(.NOT.ltrop) THEN 200 206 DO i=1,klon 201 CALL regr_conserv(1,v2(i,:,:) , Pint_in , P cen_ou(i,nbp_lev+1:1:-1), &207 CALL regr_conserv(1,v2(i,:,:) , Pint_in , Pint_ou(i,nbp_lev+1:1:-1), & 202 208 v3(i,nbp_lev:1:-1,:), slopes(1,v2(i,:,:),pint_in)) 203 209 END DO … … 206 212 DO i=1,klon 207 213 SigT_in = get_SigTrop(i,itrp) !--- input (file) tropopause 208 SigT_ou = ptrop_ou(i)/p cen_ou(i,1) !--- output (lmdz) tropopause214 SigT_ou = ptrop_ou(i)/pint_ou(i,1) !--- output (lmdz) tropopause 209 215 SigT_mn = SQRT(SigT_in*SigT_ou) !--- mean tropopause>strained domain 210 216 … … 221 227 !--- STRAINED INPUT logP PROFILE ; alpha: MAX. STRETCH. EXPONENT INCREMENT 222 228 alpha = LOG(SigT_ou/SigT_in)/LOG(SigT_in) 223 Pint_st(:) = p cen_ou(i,1) * Sig_in(:)**(1+alpha*phi(:))229 Pint_st(:) = pint_ou(i,1) * Sig_in(:)**(1+alpha*phi(:)) 224 230 225 231 !--- REGRID INPUT PROFILE ON STRAINED VERTICAL LEVELS 226 CALL regr_conserv(1,v2(i,:,:) , Pint_st, P cen_ou(i,nbp_lev+1:1:-1), &232 CALL regr_conserv(1,v2(i,:,:) , Pint_st, Pint_ou(i,nbp_lev+1:1:-1), & 227 233 v3(i,nbp_lev:1:-1,:), slopes(1,v2(i,:,:),Pint_st)) 228 234 END DO … … 275 281 END IF 276 282 lfirst=.FALSE. 283 CALL bcast(lfirst) 277 284 278 285 END SUBROUTINE update_fields … … 361 368 REAL :: prt !--- Air pressure at tropopause 362 369 REAL :: al !--- Interpolation coefficient 363 REAL :: y_frac !--- Elapsed year fraction364 370 REAL :: coef !--- Coef: North/South transition 365 371 !-------------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.