--- trunk/libf/dyn3d/conf_guide.f 2008/02/27 13:16:39 3 +++ trunk/Sources/dyn3d/Guide/conf_guide.f 2015/09/29 19:48:59 171 @@ -1,51 +1,90 @@ -! -! $Header: /home/cvsroot/LMDZ4/libf/dyn3d/conf_guide.F,v 1.1.1.1 2004/05/19 12:53:07 lmdzadmin Exp $ -! -c -c - SUBROUTINE conf_guide -c - use IOIPSL - use getparam - use guide_m - IMPLICIT NONE - -c----------------------------------------------------------------------- -c Parametres de controle du run: -c----------------------------------------------------------------------- - - call getpar('guide.eff') - - call getpar('online',1,online,'Index de controle du guide') - CALL getpar('ncep',.false.,ncep,'Coordonnee vert NCEP ou ECMWF') - CALL getpar('ini_anal',.false.,ini_anal,'Initial = analyse') - - CALL getpar('guide_u',.true.,guide_u,'guidage de u') - CALL getpar('guide_v',.true.,guide_v,'guidage de v') - CALL getpar('guide_T',.true.,guide_T,'guidage de T') - CALL getpar('guide_P',.true.,guide_P,'guidage de P') - CALL getpar('guide_Q',.true.,guide_Q,'guidage de Q') - -c Constantes de rappel. Unite : fraction de jour - CALL getpar('tau_min_u',0.02,tau_min_u,'Cste de rappel min, u') - CALL getpar('tau_max_u', 10.,tau_max_u,'Cste de rappel max, u') - CALL getpar('tau_min_v',0.02,tau_min_v,'Cste de rappel min, v') - CALL getpar('tau_max_v', 10.,tau_max_v,'Cste de rappel max, v') - CALL getpar('tau_min_T',0.02,tau_min_T,'Cste de rappel min, T') - CALL getpar('tau_max_T', 10.,tau_max_T,'Cste de rappel max, T') - CALL getpar('tau_min_Q',0.02,tau_min_Q,'Cste de rappel min, Q') - CALL getpar('tau_max_Q', 10.,tau_max_Q,'Cste de rappel max, Q') - CALL getpar('tau_min_P',0.02,tau_min_P,'Cste de rappel min, P') - CALL getpar('tau_max_P', 10.,tau_max_P,'Cste de rappel max, P') - -c Latitude min et max pour le rappel. -c dans le cas ou on 'a les analyses que sur une bande de latitudes. - CALL getpar('lat_min_guide',-90.,lat_min_guide - s ,'Latitude minimum pour le guidage ') - CALL getpar('lat_max_guide', 90.,lat_max_guide - s ,'Latitude maximum pour le guidage ') +module conf_guide_m + IMPLICIT NONE - CALL getpar + ! Constantes de rappel, en jours : + REAL:: tau_min_u = 0.03 + REAL:: tau_max_u = 10. + REAL:: tau_min_v = 0.03 + REAL:: tau_max_v = 10. + REAL:: tau_min_t = 0.03 + REAL:: tau_max_t = 10. + REAL:: tau_min_q = 0.03 + REAL:: tau_max_q = 10. + REAL:: tau_min_p = 0.03 + REAL:: tau_max_p = 10. + + LOGICAL:: ncep = .false. ! Coordonnee vert NCEP ou ECMWF + LOGICAL:: ini_anal = .false. ! Initial = analyse + LOGICAL:: guide_u = .false. ! guidage de u + LOGICAL:: guide_v = .false. ! gvidage de v + LOGICAL:: guide_t = .false. ! guidage de T + LOGICAL:: guide_q = .false. ! guidage de q + + logical:: online = .true. ! controle du guide + ! hors-ligne: x=x_rea + + ! Dans le cas où on n'a les analyses que sur une bande de latitudes : + REAL, save:: lat_min_guide ! minimum latitude for nudging, in rad + real, save:: lat_max_guide ! maximum latitude for nudging, in rad + + logical, save:: ok_guide ! guidage + REAL, save:: factt ! pas de temps entre deux appels au guidage, en jours + +contains + + SUBROUTINE conf_guide + + ! From LMDZ4/libf/dyn3d/conf_guide.F, version 1.1.1.1 2004/05/19 12:53:07 + ! Parametres de controle du run: + + use abort_gcm_m, only: abort_gcm + use comconst, only: daysec, dtvr + use conf_gcm_m, only: day_step, iperiod + use dynetat0_m, only: grossismx, grossismy + use nr_util, only: assert, pi + use unit_nml_m, only: unit_nml + + ! Local: + + REAL:: lat_min_guide_deg = -90. ! in degrees + real:: lat_max_guide_deg = 90. ! in degrees + + namelist /conf_guide_nml/ ncep, ini_anal, guide_u, guide_v, guide_t, & + guide_q, online, tau_min_u, tau_max_u, tau_min_v, tau_max_v, & + tau_min_t, tau_max_t, tau_min_q, tau_max_q, tau_min_p, tau_max_p, & + lat_min_guide_deg, lat_max_guide_deg + + !----------------------------------------------------------------------- + + print *, "Call sequence information: conf_guide" + + print *, "Enter namelist 'conf_guide_nml'." + read(unit=*, nml=conf_guide_nml) + write(unit_nml, nml=conf_guide_nml) + + lat_min_guide = lat_min_guide_deg / 180. * pi + lat_max_guide = lat_max_guide_deg / 180. * pi + + ok_guide = any((/guide_u, guide_v, guide_t, guide_q/)) + if (ok_guide .and. mod(day_step, 4 * iperiod) /= 0) call & + abort_gcm("conf_guide", 'ok_guide day_step iperiod') + + if (ok_guide .and. online) then + factt = dtvr * iperiod / daysec + print *, "factt = ", factt + if (abs(grossismx - 1.) >= 0.1 .and. abs(grossismy - 1.) >= 0.1) then + if (guide_u) call assert(factt / tau_min_u < 1, & + "conf_guide tau_min_u") + if (guide_v) call assert(factt / tau_min_v < 1, & + "conf_guide tau_min_v") + if (guide_t) call assert(factt / tau_min_t < 1, & + "conf_guide tau_min_t") + if (guide_q) call assert(factt / tau_min_q < 1, & + "conf_guide tau_min_q") + end if + end if - end + end SUBROUTINE conf_guide + +end module conf_guide_m