7 hprogram,psea,pwater,hfile,hfiletype,ozs)
54 USE modd_pgdwork, ONLY : xsumval, xsumval2, nsize, xssqo, lssqo, nsso
58 USE modi_open_aux_io_surf
59 USE modi_close_aux_io_surf
60 USE modi_read_nam_pgd_orography
63 USE modi_read_pgd_netcdf
64 USE modi_interpol_field
68 USE modi_get_size_full_n
72 USE modi_init_io_surf_n
73 USE modi_end_io_surf_n
84 USE modi_explicit_slope
86 USE yomhook
,ONLY : lhook, dr_hook
87 USE parkind1
,ONLY : jprb
104 CHARACTER(LEN=6),
INTENT(IN) :: hprogram
105 REAL,
DIMENSION(:),
INTENT(IN) :: psea
106 REAL,
DIMENSION(:),
INTENT(IN) :: pwater
107 CHARACTER(LEN=28),
INTENT(IN) :: hfile
108 CHARACTER(LEN=6),
INTENT(IN) :: hfiletype
109 LOGICAL,
INTENT(IN) :: ozs
118 REAL,
DIMENSION(:),
POINTER :: zslope
120 REAL,
PARAMETER :: pp_deg2rad= 3.141592654/180.
123 LOGICAL,
DIMENSION(NL) :: gsso
124 LOGICAL,
DIMENSION(NL) :: gsso_anis
125 LOGICAL,
DIMENSION(NL) :: gz0effi
126 LOGICAL,
DIMENSION(NL) :: gz0effj
127 INTEGER,
DIMENSION(NL) :: iflag
136 CHARACTER(LEN=28) :: yzs
137 CHARACTER(LEN=6) :: yfiletype
138 CHARACTER(LEN=28) :: yslope
139 CHARACTER(LEN=6) :: yslopefiletype
141 CHARACTER(LEN=3) :: corogtype
148 LOGICAL :: lexplicit_slope
150 REAL(KIND=JPRB) :: zhook_handle
157 IF (lhook) CALL dr_hook(
'PGD_OROGRAPHY',0,zhook_handle)
166 corogtype, xenv, limp_zs , &
167 yslope, yslopefiletype, lexplicit_slope)
178 ALLOCATE(uss%XAVG_ZS (nl))
179 ALLOCATE(uss%XSIL_ZS (nl))
180 ALLOCATE(uss%XSSO_STDEV (nl))
181 ALLOCATE(uss%XMIN_ZS (nl))
182 ALLOCATE(uss%XMAX_ZS (nl))
184 ALLOCATE(uss%XSSO_ANIS (nl))
185 ALLOCATE(uss%XSSO_DIR (nl))
186 ALLOCATE(uss%XSSO_SLOPE (nl))
188 ALLOCATE(uss%XAOSIP (nl))
189 ALLOCATE(uss%XAOSIM (nl))
190 ALLOCATE(uss%XAOSJP (nl))
191 ALLOCATE(uss%XAOSJM (nl))
192 ALLOCATE(uss%XHO2IP (nl))
193 ALLOCATE(uss%XHO2IM (nl))
194 ALLOCATE(uss%XHO2JP (nl))
195 ALLOCATE(uss%XHO2JM (nl))
198 uss%XAVG_ZS (:) = xundef
199 uss%XSIL_ZS (:) = xundef
200 uss%XSSO_STDEV(:) = xundef
201 uss%XMIN_ZS (:) = 99999.
202 uss%XMAX_ZS (:) =-99999.
204 uss%XSSO_ANIS (:) = xundef
205 uss%XSSO_DIR (:) = xundef
206 uss%XSSO_SLOPE(:) = xundef
208 uss%XAOSIP (:) = xundef
209 uss%XAOSIM (:) = xundef
210 uss%XAOSJP (:) = xundef
211 uss%XAOSJM (:) = xundef
212 uss%XHO2IP (:) = xundef
213 uss%XHO2IM (:) = xundef
214 uss%XHO2JP (:) = xundef
215 uss%XHO2JM (:) = xundef
222 ALLOCATE(xsumval(nl))
223 ALLOCATE(xsumval2(nl))
242 hfile,hfiletype,
'FULL ')
244 hfiletype,
'DIM_FULL ',idim_full,iresp)
246 hprogram,idim_full,izs)
249 WRITE(iluout,*)
'***********************************************************'
250 WRITE(iluout,*)
'* Error in orography preparation *'
251 WRITE(iluout,*)
'* Prescribed orography from atmospheric model does not *'
252 WRITE(iluout,*)
'* have the correct number of points *'
253 WRITE(iluout,*)
'* number of points in atmospheric orography: ', izs
254 WRITE(iluout,*)
'* number of points in the surface : ', nl
255 WRITE(iluout,*)
'***********************************************************'
257 CALL
abor1_sfx(
'PGD_OROGRAPHY: ATMOSPHERIC PRESCRIBED OROGRAPHY DOES NOT HAVE THE CORRECT NB OF POINTS')
260 hfiletype,
'ZS',u%XZS(:),iresp)
263 uss%XAVG_ZS(:) = u%XZS(:)
264 uss%XSIL_ZS(:) = u%XZS(:)
265 uss%XMIN_ZS(:) = u%XZS(:)
266 uss%XMAX_ZS(:) = u%XZS(:)
267 uss%XSSO_STDEV(:) = 0.
276 uss%XSSO_ANIS(:) = 0.
278 uss%XSSO_SLOPE(:) = 0.
282 DEALLOCATE(xsumval2 )
284 IF (lhook) CALL dr_hook(
'PGD_OROGRAPHY',1,zhook_handle)
288 ELSE IF (xunif_zs/=xundef)
THEN
294 uss%XAVG_ZS(:) = u%XZS(:)
295 uss%XSIL_ZS(:) = u%XZS(:)
296 uss%XMIN_ZS(:) = u%XZS(:)
297 uss%XMAX_ZS(:) = u%XZS(:)
298 uss%XSSO_STDEV(:) = 0.
307 uss%XSSO_ANIS(:) = 0.
309 uss%XSSO_SLOPE(:) = 0.
313 DEALLOCATE(xsumval2 )
315 IF (lhook) CALL dr_hook(
'PGD_OROGRAPHY',1,zhook_handle)
321 ELSEIF (len_trim(yzs)==0)
THEN
323 WRITE(iluout,*)
'***********************************************************'
324 WRITE(iluout,*)
'* Error in orography preparation *'
325 WRITE(iluout,*)
'* There is no prescribed orography and no input file *'
326 WRITE(iluout,*)
'***********************************************************'
328 CALL
abor1_sfx(
'PGD_OROGRAPHY: NO PRESCRIBED OROGRAPHY NOR INPUT FILE')
332 IF(yfiletype==
'NETCDF')
THEN
336 hprogram,
'SURF ',
' ',yzs,
'ZS ',u%XZS)
338 uss%XSIL_ZS(:) = u%XZS(:)
339 uss%XAVG_ZS(:) = u%XZS(:)
340 uss%XMIN_ZS(:) = u%XZS(:)
341 uss%XMAX_ZS(:) = u%XZS(:)
342 uss%XSSO_STDEV(:) = 0.
351 uss%XSSO_ANIS(:) = 0.
356 IF (len_trim(yslope)/=0)
THEN
361 hprogram,
'SURF ',
' ',yslope,
'slope ',zslope)
364 uss%XSSO_SLOPE(jj)=tan(zslope(jj)*pp_deg2rad)
375 cfilein = adjustl(adjustr(yzs)//
'.txt')
378 cfilein_fa = adjustl(adjustr(yzs)//
'.fa')
381 cfilein_lfi = adjustl(yzs)
384 yfiletype,
'FULL ',
'SURF ',
'READ ')
388 yfiletype,
'ZS',u%XZS(:),iresp)
397 DEALLOCATE(xsumval2 )
399 IF (lhook) CALL dr_hook(
'PGD_OROGRAPHY',1,zhook_handle)
412 hprogram,
'SURF ',yfiletype,
'A_OROG',yzs, &
416 DEALLOCATE(xsumval2 )
423 WHERE (psea(:)==1. .AND. nsize(:)==0) nsize(:) = -1
434 hprogram,iluout,nsize,uss%XAVG_ZS,
'average orography',pdef=1.)
436 hprogram,iluout,nsize,uss%XSIL_ZS,
'silhouette orography',pdef=1.)
438 hprogram,iluout,nsize,uss%XMIN_ZS,
'minimum orography',pdef=1.)
440 hprogram,iluout,nsize,uss%XMAX_ZS,
'maximum orography',pdef=1.)
443 WHERE (nsize(:)==1) iflag(:) = 0
445 hprogram,iluout,iflag,uss%XSSO_STDEV,
'standard deviation of orography',pdef=0.)
452 uss%XAVG_ZS (:) = uss%XAVG_ZS (:) * (1. - psea(:))
453 uss%XSIL_ZS (:) = uss%XSIL_ZS (:) * (1. - psea(:))
456 uss%XSSO_STDEV(:) = xundef
459 WHERE (pwater(:)==1.)
460 uss%XSSO_STDEV(:) = 0.
474 WHERE (uss%XAVG_ZS==xundef) uss%XAVG_ZS = uss%XAVG_ZS + zeps
475 WHERE (uss%XSIL_ZS==xundef) uss%XSIL_ZS = uss%XSIL_ZS + zeps
476 WHERE (uss%XMIN_ZS==xundef) uss%XMIN_ZS = uss%XMIN_ZS + zeps
477 WHERE (uss%XMAX_ZS==xundef) uss%XMAX_ZS = uss%XMAX_ZS + zeps
484 SELECT CASE (corogtype)
486 u%XZS(:) = uss%XAVG_ZS(:)
488 u%XZS(:) = uss%XAVG_ZS(:)
489 WHERE (psea(:)<1.) u%XZS(:) = uss%XAVG_ZS(:) + xenv * uss%XSSO_STDEV
491 u%XZS(:) = uss%XSIL_ZS(:)
493 u%XZS(:) = uss%XMAX_ZS(:)
495 CALL
abor1_sfx(
'PGD_OROGRAPHY: OROGRAPHY TYPE NOT SUPPORTED '//corogtype)
507 WHERE(.NOT. gsso(:)) iflag(:) = 0
508 WHERE(psea(:)==1. .AND. iflag(:)==0) iflag(:) = -1
511 hprogram,iluout,iflag,uss%XSSO_DIR,
'subgrid orography direction',pdef=0.)
513 IF (lexplicit_slope)
THEN
515 u%XZS,uss%XSSO_SLOPE)
516 ELSEIF (len_trim(yslope)==0)
THEN
518 hprogram,iluout,iflag,uss%XSSO_SLOPE,
'subgrid orography slope',pdef=0.)
522 WHERE(.NOT. gsso_anis(:)) iflag(:) = 0
523 WHERE(psea(:)==1. .AND. iflag(:)==0) iflag(:) = -1
526 hprogram,iluout,iflag,uss%XSSO_ANIS,
'subgrid orography anisotropy',pdef=0.)
529 uss%XSSO_ANIS (:) = xundef
530 uss%XSSO_DIR (:) = xundef
531 uss%XSSO_SLOPE(:) = xundef
534 WHERE (pwater(:)==1.)
535 uss%XSSO_ANIS (:) = 1.
536 uss%XSSO_DIR (:) = 0.
537 uss%XSSO_SLOPE(:) = 0.
546 gz0effi,gz0effj,psea)
549 WHERE(.NOT. gz0effi(:)) iflag(:) = 0
550 WHERE(psea(:)==1. .AND. iflag(:)==0) iflag(:) = -1
552 hprogram,iluout,iflag,uss%XAOSIP,
'subgrid orography A/S, direction i+',pdef=0.)
554 hprogram,iluout,iflag,uss%XAOSIM,
'subgrid orography A/S, direction i-',pdef=0.)
556 hprogram,iluout,iflag,uss%XHO2IP,
'subgrid orography h/2, direction i+',pdef=0.)
558 hprogram,iluout,iflag,uss%XHO2IM,
'subgrid orography h/2, direction i-',pdef=0.)
561 WHERE(.NOT. gz0effj(:)) iflag(:) = 0
562 WHERE(psea(:)==1. .AND. iflag(:)==0) iflag(:) = -1
564 hprogram,iluout,iflag,uss%XAOSJP,
'subgrid orography A/S, direction j+',pdef=0.)
566 hprogram,iluout,iflag,uss%XAOSJM,
'subgrid orography A/S, direction j-',pdef=0.)
568 hprogram,iluout,iflag,uss%XHO2JP,
'subgrid orography h/2, direction j+',pdef=0.)
570 hprogram,iluout,iflag,uss%XHO2JM,
'subgrid orography h/2, direction j-',pdef=0.)
573 uss%XHO2IP(:) = xundef
574 uss%XHO2IM(:) = xundef
575 uss%XHO2JP(:) = xundef
576 uss%XHO2JM(:) = xundef
577 uss%XAOSIP(:) = xundef
578 uss%XAOSIM(:) = xundef
579 uss%XAOSJP(:) = xundef
580 uss%XAOSJM(:) = xundef
583 WHERE (pwater(:)==1.)
595 IF (lhook) CALL dr_hook(
'PGD_OROGRAPHY',1,zhook_handle)
subroutine init_io_surf_n(DTCO, DGU, U, HPROGRAM, HMASK, HSCHEME, HACTION)
subroutine read_nam_pgd_orography(HPROGRAM, HZS, HFILETYPE, PUNIF_ZS, HOROGTYPE, PENV, OIMP_ZS, HSLOPE, HSLOPEFILETYPE, OEXPLICIT_SLOPE)
subroutine sso(UG, USS, OSSO, OSSO_ANIS, PSEA)
subroutine read_sso_n(U, USS, HPROGRAM)
subroutine close_aux_io_surf(HFILE, HFILETYPE)
subroutine treat_field(UG, U, USS, HPROGRAM, HSCHEME, HFILETYPE, HSUBROUTINE, HFILENAME, HFIELD, PPGDARRAY, HSFTYPE)
subroutine abor1_sfx(YTEXT)
subroutine pgd_orography(DGU, DTCO, UG, U, USS, HPROGRAM, PSEA, PWATER, HFILE, HFILETYPE, OZS)
subroutine open_aux_io_surf(HFILE, HFILETYPE, HMASK)
subroutine ini_ssowork(PMESHLENGTH, PDLAT, PDLON)
subroutine subscale_aos(UG, USS, OZ0EFFI, OZ0EFFJ, PSEA)
subroutine end_io_surf_n(HPROGRAM)
subroutine get_luout(HPROGRAM, KLUOUT)
subroutine interpol_field(UG, U, HPROGRAM, KLUOUT, KCODE, PFIELD, HFIELD, PDEF, KNPTS)
subroutine explicit_slope(UG, PZS, PSSO_SLOPE)
subroutine get_size_full_n(U, HPROGRAM, KDIM_FULL, KSIZE_FULL)
subroutine read_pgd_netcdf(USS, HPROGRAM, HSCHEME, HSUBROUTINE, HFILENAME, HFIELD, PFIELD)