Ignore:
Timestamp:
Oct 24, 2024, 5:53:15 PM (4 months ago)
Author:
abarral
Message:

Turn paramet.h into a module

Location:
LMDZ6/trunk/libf/phylmd/dyn1d
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/dyn1d/1DUTILS.h

    r5271 r5272  
    1 INCLUDE "conf_gcm.f90"
     1#include "conf_gcm.f90"
    22
    33!
     
    1818!   --------------
    1919
    20 INCLUDE "compar1d.h"
    21 INCLUDE "flux_arp.h"
    22 INCLUDE "tsoilnudge.h"
    23 INCLUDE "fcg_gcssold.h"
    24 INCLUDE "fcg_racmo.h"
     20#include "compar1d.h"
     21#include "flux_arp.h"
     22#include "tsoilnudge.h"
     23#include "fcg_gcssold.h"
     24#include "fcg_racmo.h"
    2525!
    2626!
     
    2929
    3030!      CHARACTER ch1*72,ch2*72,ch3*72,ch4*12
    31      
     31
    3232!
    3333!  -------------------------------------------------------------------
     
    4242!Config  Desc = unite de fichier pour les impressions
    4343!Config  Def  = 6
    44 !Config  Help = unite de fichier pour les impressions 
     44!Config  Help = unite de fichier pour les impressions
    4545!Config         (defaut sortie standard = 6)
    4646      lunout=6
     
    7474!!Config  Help = 0 ==> forcing_les = .true.
    7575!             initial profiles from file prof.inp.001
    76 !             no forcing by LS convergence ; 
     76!             no forcing by LS convergence ;
    7777!             surface temperature imposed ;
    7878!             radiative cooling may be imposed (iflag_radia=0 in physiq.def)
    7979!         = 1 ==> forcing_radconv = .true.
    80 !             idem forcing_type = 0, but the imposed radiative cooling 
    81 !             is set to 0 (hence, if iflag_radia=0 in physiq.def, 
     80!             idem forcing_type = 0, but the imposed radiative cooling
     81!             is set to 0 (hence, if iflag_radia=0 in physiq.def,
    8282!             then there is no radiative cooling at all)
    8383!         = 2 ==> forcing_toga = .true.
    84 !             initial profiles from TOGA-COARE IFA files 
    85 !             LS convergence and SST imposed from TOGA-COARE IFA files 
     84!             initial profiles from TOGA-COARE IFA files
     85!             LS convergence and SST imposed from TOGA-COARE IFA files
    8686!         = 3 ==> forcing_GCM2SCM = .true.
    8787!             initial profiles from the GCM output
    8888!             LS convergence imposed from the GCM output
    8989!         = 4 ==> forcing_twpi = .true.
    90 !             initial profiles from TWPICE nc files 
    91 !             LS convergence and SST imposed from TWPICE nc files 
     90!             initial profiles from TWPICE nc files
     91!             LS convergence and SST imposed from TWPICE nc files
    9292!         = 5 ==> forcing_rico = .true.
    9393!             initial profiles from RICO idealized
    94 !             LS convergence imposed from  RICO (cst) 
     94!             LS convergence imposed from  RICO (cst)
    9595!         = 6 ==> forcing_amma = .true.
    9696!         = 10 ==> forcing_case = .true.
    97 !             initial profiles from case.nc file 
     97!             initial profiles from case.nc file
    9898!         = 40 ==> forcing_GCSSold = .true.
    9999!             initial profile from GCSS file
     
    105105!             Radiation has to be computed interactively
    106106!         = 60 ==> forcing_astex = .true.
    107 !             initial profiles from file: see prof.inp.001 
     107!             initial profiles from file: see prof.inp.001
    108108!             SST,divergence,ug,vg,ufa,vfa varying with time : see ifa_astex.txt file
    109109!             Radiation has to be computed interactively
    110110!         = 61 ==> forcing_armcu = .true.
    111 !             initial profiles from file: see prof.inp.001 
     111!             initial profiles from file: see prof.inp.001
    112112!             sensible and latent heat flux imposed: see ifa_arm_cu_1.txt
    113113!             large scale advective forcing & radiative tendencies applied below 1000m: see ifa_arm_cu_2.txt
    114 !             use geostrophic wind ug=10m/s vg=0m/s. Duration of the case 53100s 
     114!             use geostrophic wind ug=10m/s vg=0m/s. Duration of the case 53100s
    115115!             Radiation to be switched off
    116116!         > 100 ==> forcing_case = .true. or forcing_case2 = .true.
    117 !             initial profiles from case.nc file 
     117!             initial profiles from case.nc file
    118118!
    119119       forcing_type = 0
    120120       CALL getin('forcing_type',forcing_type)
    121121         imp_fcg_gcssold   = .false.
    122          ts_fcg_gcssold    = .false. 
    123          Tp_fcg_gcssold    = .false. 
    124          Tp_ini_gcssold    = .false. 
    125          xTurb_fcg_gcssold = .false. 
     122         ts_fcg_gcssold    = .false.
     123         Tp_fcg_gcssold    = .false.
     124         Tp_ini_gcssold    = .false.
     125         xTurb_fcg_gcssold = .false.
    126126        IF (forcing_type .eq.40) THEN
    127127          CALL getin('imp_fcg',imp_fcg_gcssold)
     
    261261!Config  Desc = meaningless in this  case
    262262!Config  Def  = 0.
    263 !Config  Help = 
     263!Config  Help =
    264264       time_ini = 0.
    265265       CALL getin('time_ini',time_ini)
     
    277277!Config  Desc = Grid cell area
    278278!Config  Def  = 1.e11
    279 !Config  Help = 
     279!Config  Help =
    280280       airefi = 1.e11
    281281       CALL getin('airephy',airefi)
     
    298298!Config  Desc = surface pressure
    299299!Config  Def  = 102400.
    300 !Config  Help = 
     300!Config  Help =
    301301       psurf = 102400.
    302302       CALL getin('psurf',psurf)
     
    305305!Config  Desc = surface altitude
    306306!Config  Def  = 0.
    307 !Config  Help = 
     307!Config  Help =
    308308       zsurf = 0.
    309309       CALL getin('zsurf',zsurf)
    310 ! EV pour accord avec format standard       
     310! EV pour accord avec format standard
    311311       CALL getin('zorog',zsurf)
    312312
     
    340340!Config  Desc = ???
    341341!Config  Def  = 0.0 0.0
    342 !Config  Help = 
     342!Config  Help =
    343343       wtsurf = 0.0
    344344       wqsurf = 0.0
     
    349349!Config  Desc = albedo
    350350!Config  Def  = 0.09
    351 !Config  Help = 
     351!Config  Help =
    352352       albedo = 0.09
    353353       CALL getin('albedo',albedo)
     
    356356!Config  Desc = age de la neige
    357357!Config  Def  = 30.0
    358 !Config  Help = 
     358!Config  Help =
    359359       xagesno = 30.0
    360360       CALL getin('agesno',xagesno)
     
    363363!Config  Desc = age de la neige
    364364!Config  Def  = 30.0
    365 !Config  Help = 
     365!Config  Help =
    366366       restart_runoff = 0.0
    367367       CALL getin('restart_runoff',restart_runoff)
     
    370370!Config  Desc = initial bucket water content (kg/m2) when land (5std)
    371371!Config  Def  = 30.0
    372 !Config  Help = 
     372!Config  Help =
    373373       qsolinp = 1.
    374374       CALL getin('qsolinp',qsolinp)
     
    379379!Config  Desc = beta for actual evaporation when prescribed
    380380!Config  Def  = 1.0
    381 !Config  Help = 
     381!Config  Help =
    382382       betaevap = 1.
    383        CALL getin('betaevap',betaevap)     
     383       CALL getin('betaevap',betaevap)
    384384
    385385!Config  Key  = zpicinp
     
    689689      real :: q(klon,klev,nqtot),omega2(klon,klev)
    690690!      real :: ug(klev),vg(klev),fcoriolis
    691       real :: phis(klon) 
     691      real :: phis(klon)
    692692
    693693!   Variables locales pour NetCDF:
     
    719719!
    720720      CALL get_var("controle",tab_cntrl)
    721        
     721
    722722
    723723      im         = tab_cntrl(1)
     
    755755        fxyhypb = .false.
    756756        ysinus  = .false.
    757         IF( tab_cntrl(27).EQ.1. ) ysinus =.true. 
     757        IF( tab_cntrl(27).EQ.1. ) ysinus =.true.
    758758      ENDIF
    759759
     
    837837      real :: omega2(klon,klev),rho(klon,klev+1)
    838838!      real :: ug(klev),vg(klev),fcoriolis
    839       real :: phis(klon) 
     839      real :: phis(klon)
    840840
    841841!   Variables locales pour NetCDF:
     
    893893!       tab_cntrl(19) = preff
    894894!
    895 !    .....    parametres  pour le zoom      ......   
     895!    .....    parametres  pour le zoom      ......
    896896
    897897!       tab_cntrl(20)  = clon
     
    957957!   passage d'un champ de la grille scalaire a la grille physique
    958958!=======================================================================
    959  
     959
    960960!-----------------------------------------------------------------------
    961961!   declarations:
    962962!   -------------
    963  
     963
    964964      INTEGER im,jm,ngrid,nfield
    965965      REAL pdyn(im,jm,nfield)
    966966      REAL pfi(ngrid,nfield)
    967  
     967
    968968      INTEGER i,j,ifield,ig
    969  
     969
    970970!-----------------------------------------------------------------------
    971971!   calcul:
    972972!   -------
    973  
     973
    974974      DO ifield=1,nfield
    975975!   traitement des poles
     
    978978            pdyn(i,jm,ifield)=pfi(ngrid,ifield)
    979979         ENDDO
    980  
     980
    981981!   traitement des point normaux
    982982         DO j=2,jm-1
     
    986986         ENDDO
    987987      ENDDO
    988  
     988
    989989      RETURN
    990990      END
    991  
    992  
     991
     992
    993993
    994994      SUBROUTINE abort_gcm(modname, message, ierr)
    995  
     995
    996996      USE IOIPSL
    997997!
     
    10021002!         message = stuff to print
    10031003!         ierr    = severity of situation ( = 0 normal )
    1004  
     1004
    10051005      character(len=*) modname
    10061006      integer ierr
    10071007      character(len=*) message
    1008  
     1008
    10091009      write(*,*) 'in abort_gcm'
    10101010      call histclo
     
    10841084      RETURN
    10851085      END
    1086  
     1086
    10871087      SUBROUTINE gr_dyn_fi(nfield,im,jm,ngrid,pdyn,pfi)
    10881088      IMPLICIT NONE
     
    10901090!   passage d'un champ de la grille scalaire a la grille physique
    10911091!=======================================================================
    1092  
     1092
    10931093!-----------------------------------------------------------------------
    10941094!   declarations:
    10951095!   -------------
    1096  
     1096
    10971097      INTEGER im,jm,ngrid,nfield
    10981098      REAL pdyn(im,jm,nfield)
    10991099      REAL pfi(ngrid,nfield)
    1100  
     1100
    11011101      INTEGER j,ifield,ig
    1102  
     1102
    11031103!-----------------------------------------------------------------------
    11041104!   calcul:
    11051105!   -------
    1106  
     1106
    11071107      IF(ngrid.NE.2+(jm-2)*(im-1).AND.ngrid.NE.1)                          &
    11081108     &    STOP 'probleme de dim'
     
    11101110      CALL SCOPY(nfield,pdyn,im*jm,pfi,ngrid)
    11111111      CALL SCOPY(nfield,pdyn(1,jm,1),im*jm,pfi(ngrid,1),ngrid)
    1112  
     1112
    11131113!   traitement des point normaux
    11141114      DO ifield=1,nfield
     
    11181118         ENDDO
    11191119      ENDDO
    1120  
     1120
    11211121      RETURN
    11221122      END
    1123  
     1123
    11241124      SUBROUTINE disvert0(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig)
    1125  
     1125
    11261126!    Ancienne version disvert dont on a modifie nom pour utiliser
    11271127!    le disvert de dyn3d (qui permet d'utiliser grille avec ab,bp imposes)
     
    11311131!
    11321132      USE dimensions_mod, ONLY: iim, jjm, llm, ndm
     1133USE paramet_mod_h, ONLY: iip1, iip2, iip3, jjp1, llmp1, llmp2, llmm1, kftd, ip1jm, ip1jmp1, &
     1134          ip1jmi1, ijp1llm, ijmllm, mvar, jcfil, jcfllm
    11331135IMPLICIT NONE
    11341136
    11351137
    1136       include "paramet.h"
     1138
    11371139!
    11381140!=======================================================================
     
    11601162      INTEGER np,ierr
    11611163      REAL pi,x
    1162  
     1164
    11631165!-----------------------------------------------------------------------
    11641166!
    11651167      pi=2.*ASIN(1.)
    1166  
     1168
    11671169      OPEN(99,file='sigma.def',status='old',form='formatted',                   &
    11681170     &   iostat=ierr)
    1169  
     1171
    11701172!-----------------------------------------------------------------------
    11711173!   cas 1 on lit les options dans sigma.def:
    11721174!   ----------------------------------------
    1173  
     1175
    11741176      IF (ierr.eq.0) THEN
    1175  
     1177
    11761178      print*,'WARNING!!! on lit les options dans sigma.def'
    11771179      READ(99,*) deltaz
     
    11841186      alpha=deltaz/(llm*h)
    11851187!
    1186  
     1188
    11871189       DO 1  l = 1, llm
    11881190       dsig(l) = (alpha+(1.-alpha)*exp(-beta*(llm-l)))*                    &
     
    11901192     &            (1.-l/FLOAT(llm))*delta )
    11911193   1   CONTINUE
    1192  
     1194
    11931195       sig(1)=1.
    11941196       DO 101 l=1,llm-1
     
    11961198101    CONTINUE
    11971199       sig(llm+1)=0.
    1198  
     1200
    11991201       DO 2  l = 1, llm
    12001202       dsig(l) = sig(l)-sig(l+1)
    12011203   2   CONTINUE
    12021204!
    1203  
     1205
    12041206      ELSE
    12051207!-----------------------------------------------------------------------
    12061208!   cas 2 ancienne discretisation (LMD5...):
    12071209!   ----------------------------------------
    1208  
     1210
    12091211      PRINT*,'WARNING!!! Ancienne discretisation verticale'
    1210  
     1212
    12111213      h=7.
    12121214      snorm  = 0.
     
    12241226         sig(l) = sig(l+1) + dsig(l)
    12251227      ENDDO
    1226  
     1228
    12271229      ENDIF
    1228  
    1229  
     1230
     1231
    12301232      DO l=1,llm
    12311233        nivsigs(l) = FLOAT(l)
    12321234      ENDDO
    1233  
     1235
    12341236      DO l=1,llmp1
    12351237        nivsig(l)= FLOAT(l)
    12361238      ENDDO
    1237  
     1239
    12381240!
    12391241!    ....  Calculs  de ap(l) et de bp(l)  ....
     
    12431245!   .....  pa et preff sont lus  sur les fichiers start par lectba  .....
    12441246!
    1245  
     1247
    12461248      bp(llmp1) =   0.
    1247  
     1249
    12481250      DO l = 1, llm
    12491251!c
    12501252!cc    ap(l) = 0.
    12511253!cc    bp(l) = sig(l)
    1252  
     1254
    12531255      bp(l) = EXP( 1. -1./( sig(l)*sig(l)) )
    12541256      ap(l) = pa * ( sig(l) - bp(l) )
     
    12561258      ENDDO
    12571259      ap(llmp1) = pa * ( sig(llmp1) - bp(llmp1) )
    1258  
     1260
    12591261      PRINT *,' BP '
    12601262      PRINT *,  bp
    12611263      PRINT *,' AP '
    12621264      PRINT *,  ap
    1263  
     1265
    12641266      DO l = 1, llm
    12651267       dpres(l) = bp(l) - bp(l+1)
    12661268       presnivs(l) = 0.5 *( ap(l)+bp(l)*preff + ap(l+1)+bp(l+1)*preff )
    12671269      ENDDO
    1268  
     1270
    12691271      PRINT *,' PRESNIVS '
    12701272      PRINT *,presnivs
    1271  
     1273
    12721274      RETURN
    12731275      END
     
    12991301!   Schema amont pour l'advection verticale en 1D
    13001302!   w est la vitesse verticale dp/dt en Pa/s
    1301 !   Traitement en volumes finis 
     1303!   Traitement en volumes finis
    13021304!   d / dt ( zm q ) = delta_z ( omega q )
    13031305!   d / dt ( zm ) = delta_z ( omega )
     
    13271329      zwq(llm+1)=0.
    13281330      zw(llm+1)=0.
    1329  
     1331
    13301332      do l=1,llm
    13311333         qold=q(l)
     
    13341336      enddo
    13351337
    1336  
     1338
    13371339      return
    13381340      end
     
    13431345       SUBROUTINE advect_va(llm,omega,d_t_va,d_q_va,d_u_va,d_v_va,              &
    13441346     &                q,temp,u,v,play)
    1345 !itlmd 
     1347!itlmd
    13461348!----------------------------------------------------------------------
    1347 !   Calcul de l'advection verticale (ascendance et subsidence) de 
     1349!   Calcul de l'advection verticale (ascendance et subsidence) de
    13481350!   temperature et d'humidite. Hypothese : ce qui rentre de l'exterieur
    1349 !   a les memes caracteristiques que l'air de la colonne 1D (WTG) ou 
    1350 !   sans WTG rajouter une advection horizontale 
    1351 !---------------------------------------------------------------------- 
     1351!   a les memes caracteristiques que l'air de la colonne 1D (WTG) ou
     1352!   sans WTG rajouter une advection horizontale
     1353!----------------------------------------------------------------------
    13521354        implicit none
    13531355INCLUDE "YOMCST.h"
     
    13711373     &       /(play(l)-play(l+1))
    13721374
    1373         d_q_va(l,:)= -omgdown*(q(l,:)-q(l+1,:))/(play(l)-play(l+1))             
    1374 
    1375         d_u_va(l)= -omgdown*(u(l)-u(l+1))/(play(l)-play(l+1))             
    1376         d_v_va(l)= -omgdown*(v(l)-v(l+1))/(play(l)-play(l+1))             
    1377 
    1378        
     1375        d_q_va(l,:)= -omgdown*(q(l,:)-q(l+1,:))/(play(l)-play(l+1))
     1376
     1377        d_u_va(l)= -omgdown*(u(l)-u(l+1))/(play(l)-play(l+1))
     1378        d_v_va(l)= -omgdown*(v(l)-v(l+1))/(play(l)-play(l+1))
     1379
     1380
    13791381       elseif(l.eq.llm) then
    13801382        omgup=min(omega(l),0.0)
     
    13871389        d_u_va(l)= -omgup*(u(l-1)-u(l))/(play(l-1)-play(l))
    13881390        d_v_va(l)= -omgup*(v(l-1)-v(l))/(play(l-1)-play(l))
    1389        
     1391
    13901392       else
    13911393        omgup=min(omega(l),0.0)
     
    14001402        d_q_va(l,:)= -omgdown*(q(l,:)-q(l+1,:))                            &
    14011403     &              /(play(l)-play(l+1))-                                  &
    1402      &              omgup*(q(l-1,:)-q(l,:))/(play(l-1)-play(l)) 
     1404     &              omgup*(q(l-1,:)-q(l,:))/(play(l-1)-play(l))
    14031405        d_u_va(l)= -omgdown*(u(l)-u(l+1))                                  &
    14041406     &              /(play(l)-play(l+1))-                                  &
    1405      &              omgup*(u(l-1)-u(l))/(play(l-1)-play(l)) 
     1407     &              omgup*(u(l-1)-u(l))/(play(l-1)-play(l))
    14061408        d_v_va(l)= -omgdown*(v(l)-v(l+1))                                  &
    14071409     &              /(play(l)-play(l+1))-                                  &
    14081410     &              omgup*(v(l-1)-v(l))/(play(l-1)-play(l))
    1409        
     1411
    14101412      endif
    1411          
     1413
    14121414      enddo
    14131415!fin itlmd
     
    14171419       SUBROUTINE lstendH(llm,nqtot,omega,d_t_va,d_q_va,                        &
    14181420     &                q,temp,u,v,play)
    1419 !itlmd 
     1421!itlmd
    14201422!----------------------------------------------------------------------
    1421 !   Calcul de l'advection verticale (ascendance et subsidence) de 
     1423!   Calcul de l'advection verticale (ascendance et subsidence) de
    14221424!   temperature et d'humidite. Hypothese : ce qui rentre de l'exterieur
    1423 !   a les memes caracteristiques que l'air de la colonne 1D (WTG) ou 
    1424 !   sans WTG rajouter une advection horizontale 
    1425 !---------------------------------------------------------------------- 
     1425!   a les memes caracteristiques que l'air de la colonne 1D (WTG) ou
     1426!   sans WTG rajouter une advection horizontale
     1427!----------------------------------------------------------------------
    14261428        implicit none
    14271429INCLUDE "YOMCST.h"
     
    16481650!jyg<
    16491651!   Formule pour q :
    1650 !                         d_q = (1/tau) [rh_targ*qsat(T_new) - q] 
     1652!                         d_q = (1/tau) [rh_targ*qsat(T_new) - q]
    16511653!
    16521654!  Cette formule remplace d_q = (1/tau) [rh_targ - rh] qsat(T_new)
     
    17431745     &         ,dt_mod_cas,ht_mod_cas,vt_mod_cas,dtrad_mod_cas,dq_mod_cas,hq_mod_cas,vq_mod_cas        &
    17441746     &         ,dth_mod_cas,hth_mod_cas,vth_mod_cas,mxcalc)
    1745  
     1747
    17461748       USE dimensions_mod, ONLY: iim, jjm, llm, ndm
    17471749implicit none
  • LMDZ6/trunk/libf/phylmd/dyn1d/lmdz1d.F90

    r5271 r5272  
    2626
    2727
    28 INCLUDE "1DUTILS.h"
    29 INCLUDE "1Dconv.h"
     28#include "1DUTILS.h"
     29#include "1Dconv.h"
    3030
    3131!#endif
  • LMDZ6/trunk/libf/phylmd/dyn1d/paramet_mod_h.f90

    r5271 r5272  
    1 link ../../dyn3d/paramet.h
     1link ../../dyn3d/paramet_mod_h.f90
Note: See TracChangeset for help on using the changeset viewer.