Ignore:
Timestamp:
Jul 24, 2024, 2:54:37 PM (4 months ago)
Author:
abarral
Message:

rename modules properly lmdz_*
move ismin, ismax, minmax into new lmdz_libmath.f90
(lint) uppercase fortran keywords

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_1dutils.f90

    r5113 r5116  
    4242    temp = kelvin
    4343    pres = millibar * 100.0
    44     !      write(*,*)'kelvin,millibar=',kelvin,millibar
    45     !      write(*,*)'temp,pres=',temp,pres
     44    !      WRITE(*,*)'kelvin,millibar=',kelvin,millibar
     45    !      WRITE(*,*)'temp,pres=',temp,pres
    4646
    4747    IF (temp <= rtt) THEN
     
    642642    CALL getin('nudging_t', nudging_t)
    643643
    644     write(lunout, *)' +++++++++++++++++++++++++++++++++++++++'
    645     write(lunout, *)' Configuration des parametres du gcm1D: '
    646     write(lunout, *)' +++++++++++++++++++++++++++++++++++++++'
    647     write(lunout, *)' restart = ', restart
    648     write(lunout, *)' forcing_type = ', forcing_type
    649     write(lunout, *)' time_ini = ', time_ini
    650     write(lunout, *)' rlat = ', xlat
    651     write(lunout, *)' rlon = ', xlon
    652     write(lunout, *)' airephy = ', airefi
    653     write(lunout, *)' nat_surf = ', nat_surf
    654     write(lunout, *)' tsurf = ', tsurf
    655     write(lunout, *)' psurf = ', psurf
    656     write(lunout, *)' zsurf = ', zsurf
    657     write(lunout, *)' rugos = ', rugos
    658     write(lunout, *)' snowmass=', snowmass
    659     write(lunout, *)' wtsurf = ', wtsurf
    660     write(lunout, *)' wqsurf = ', wqsurf
    661     write(lunout, *)' albedo = ', albedo
    662     write(lunout, *)' xagesno = ', xagesno
    663     write(lunout, *)' restart_runoff = ', restart_runoff
    664     write(lunout, *)' qsolinp = ', qsolinp
    665     write(lunout, *)' zpicinp = ', zpicinp
    666     write(lunout, *)' nudge_tsoil = ', nudge_tsoil
    667     write(lunout, *)' isoil_nudge = ', isoil_nudge
    668     write(lunout, *)' Tsoil_nudge = ', Tsoil_nudge
    669     write(lunout, *)' tau_soil_nudge = ', tau_soil_nudge
    670     write(lunout, *)' tadv =      ', tadv
    671     write(lunout, *)' tadvv =     ', tadvv
    672     write(lunout, *)' tadvh =     ', tadvh
    673     write(lunout, *)' thadv =     ', thadv
    674     write(lunout, *)' thadvv =    ', thadvv
    675     write(lunout, *)' thadvh =    ', thadvh
    676     write(lunout, *)' qadv =      ', qadv
    677     write(lunout, *)' qadvv =     ', qadvv
    678     write(lunout, *)' qadvh =     ', qadvh
    679     write(lunout, *)' trad =      ', trad
    680     write(lunout, *)' forc_omega = ', forc_omega
    681     write(lunout, *)' forc_w     = ', forc_w
    682     write(lunout, *)' forc_geo   = ', forc_geo
    683     write(lunout, *)' forc_ustar = ', forc_ustar
    684     write(lunout, *)' nudging_u  = ', nudging_u
    685     write(lunout, *)' nudging_v  = ', nudging_v
    686     write(lunout, *)' nudging_t  = ', nudging_t
    687     write(lunout, *)' nudging_qv  = ', nudging_qv
     644    WRITE(lunout, *)' +++++++++++++++++++++++++++++++++++++++'
     645    WRITE(lunout, *)' Configuration des parametres du gcm1D: '
     646    WRITE(lunout, *)' +++++++++++++++++++++++++++++++++++++++'
     647    WRITE(lunout, *)' restart = ', restart
     648    WRITE(lunout, *)' forcing_type = ', forcing_type
     649    WRITE(lunout, *)' time_ini = ', time_ini
     650    WRITE(lunout, *)' rlat = ', xlat
     651    WRITE(lunout, *)' rlon = ', xlon
     652    WRITE(lunout, *)' airephy = ', airefi
     653    WRITE(lunout, *)' nat_surf = ', nat_surf
     654    WRITE(lunout, *)' tsurf = ', tsurf
     655    WRITE(lunout, *)' psurf = ', psurf
     656    WRITE(lunout, *)' zsurf = ', zsurf
     657    WRITE(lunout, *)' rugos = ', rugos
     658    WRITE(lunout, *)' snowmass=', snowmass
     659    WRITE(lunout, *)' wtsurf = ', wtsurf
     660    WRITE(lunout, *)' wqsurf = ', wqsurf
     661    WRITE(lunout, *)' albedo = ', albedo
     662    WRITE(lunout, *)' xagesno = ', xagesno
     663    WRITE(lunout, *)' restart_runoff = ', restart_runoff
     664    WRITE(lunout, *)' qsolinp = ', qsolinp
     665    WRITE(lunout, *)' zpicinp = ', zpicinp
     666    WRITE(lunout, *)' nudge_tsoil = ', nudge_tsoil
     667    WRITE(lunout, *)' isoil_nudge = ', isoil_nudge
     668    WRITE(lunout, *)' Tsoil_nudge = ', Tsoil_nudge
     669    WRITE(lunout, *)' tau_soil_nudge = ', tau_soil_nudge
     670    WRITE(lunout, *)' tadv =      ', tadv
     671    WRITE(lunout, *)' tadvv =     ', tadvv
     672    WRITE(lunout, *)' tadvh =     ', tadvh
     673    WRITE(lunout, *)' thadv =     ', thadv
     674    WRITE(lunout, *)' thadvv =    ', thadvv
     675    WRITE(lunout, *)' thadvh =    ', thadvh
     676    WRITE(lunout, *)' qadv =      ', qadv
     677    WRITE(lunout, *)' qadvv =     ', qadvv
     678    WRITE(lunout, *)' qadvh =     ', qadvh
     679    WRITE(lunout, *)' trad =      ', trad
     680    WRITE(lunout, *)' forc_omega = ', forc_omega
     681    WRITE(lunout, *)' forc_w     = ', forc_w
     682    WRITE(lunout, *)' forc_geo   = ', forc_geo
     683    WRITE(lunout, *)' forc_ustar = ', forc_ustar
     684    WRITE(lunout, *)' nudging_u  = ', nudging_u
     685    WRITE(lunout, *)' nudging_v  = ', nudging_v
     686    WRITE(lunout, *)' nudging_t  = ', nudging_t
     687    WRITE(lunout, *)' nudging_qv  = ', nudging_qv
    688688    IF (forcing_type ==40) THEN
    689       write(lunout, *) '--- Forcing type GCSS Old --- with:'
    690       write(lunout, *)'imp_fcg', imp_fcg_gcssold
    691       write(lunout, *)'ts_fcg', ts_fcg_gcssold
    692       write(lunout, *)'tp_fcg', Tp_fcg_gcssold
    693       write(lunout, *)'tp_ini', Tp_ini_gcssold
    694       write(lunout, *)'xturb_fcg', xTurb_fcg_gcssold
     689      WRITE(lunout, *) '--- Forcing type GCSS Old --- with:'
     690      WRITE(lunout, *)'imp_fcg', imp_fcg_gcssold
     691      WRITE(lunout, *)'ts_fcg', ts_fcg_gcssold
     692      WRITE(lunout, *)'tp_fcg', Tp_fcg_gcssold
     693      WRITE(lunout, *)'tp_ini', Tp_ini_gcssold
     694      WRITE(lunout, *)'xturb_fcg', xTurb_fcg_gcssold
    695695    ENDIF
    696696
    697     write(lunout, *)' +++++++++++++++++++++++++++++++++++++++'
    698     write(lunout, *)
     697    WRITE(lunout, *)' +++++++++++++++++++++++++++++++++++++++'
     698    WRITE(lunout, *)
    699699
    700700  END SUBROUTINE conf_unicol
     
    729729    CHARACTER*(*) fichnom
    730730    !Al1 plev tronque pour .nc mais plev(klev+1):=0
    731     real :: plev(klon, klev + 1), play (klon, klev), phi(klon, klev)
    732     real :: presnivs(klon, klev)
    733     real :: ucov(klon, klev), vcov(klon, klev), temp(klon, klev)
    734     real :: q(klon, klev, nqtot), omega2(klon, klev)
    735     !      real :: ug(klev),vg(klev),fcoriolis
    736     real :: phis(klon)
     731    REAL :: plev(klon, klev + 1), play (klon, klev), phi(klon, klev)
     732    REAL :: presnivs(klon, klev)
     733    REAL :: ucov(klon, klev), vcov(klon, klev), temp(klon, klev)
     734    REAL :: q(klon, klev, nqtot), omega2(klon, klev)
     735    !      REAL :: ug(klev),vg(klev),fcoriolis
     736    REAL :: phis(klon)
    737737
    738738    !   Variables locales pour NetCDF:
     
    751751    !!      nmq(2)="cond"
    752752    !!      do iq=3,nqtot
    753     !!        write(nmq(iq),'("tra",i1)') iq-2
     753    !!        WRITE(nmq(iq),'("tra",i1)') iq-2
    754754    !!      enddo
    755755    DO iq = 1, nqtot
     
    862862    CHARACTER*(*) fichnom
    863863    !Al1 plev tronque pour .nc mais plev(klev+1):=0
    864     real :: plev(klon, klev), play (klon, klev), phi(klon, klev)
    865     real :: presnivs(klon, klev)
    866     real :: ucov(klon, klev), vcov(klon, klev), temp(klon, klev)
    867     real :: q(klon, klev, nqtot)
    868     real :: omega2(klon, klev), rho(klon, klev + 1)
    869     !      real :: ug(klev),vg(klev),fcoriolis
    870     real :: phis(klon)
     864    REAL :: plev(klon, klev), play (klon, klev), phi(klon, klev)
     865    REAL :: presnivs(klon, klev)
     866    REAL :: ucov(klon, klev), vcov(klon, klev), temp(klon, klev)
     867    REAL :: q(klon, klev, nqtot)
     868    REAL :: omega2(klon, klev), rho(klon, klev + 1)
     869    !      REAL :: ug(klev),vg(klev),fcoriolis
     870    REAL :: phis(klon)
    871871
    872872    !   Variables locales pour NetCDF:
     
    10311031    !         ierr    = severity of situation ( = 0 normal )
    10321032
    1033     character(len = *) modname
     1033    CHARACTER(LEN = *) modname
    10341034    integer ierr
    1035     character(len = *) message
    1036 
    1037     write(*, *) 'in abort_gcm'
     1035    CHARACTER(LEN = *) message
     1036
     1037    WRITE(*, *) 'in abort_gcm'
    10381038    CALL histclo
    10391039    !     CALL histclo(2)
     
    10411041    !     CALL histclo(4)
    10421042    !     CALL histclo(5)
    1043     write(*, *) 'out of histclo'
    1044     write(*, *) 'Stopping in ', modname
    1045     write(*, *) 'Reason = ', message
     1043    WRITE(*, *) 'out of histclo'
     1044    WRITE(*, *) 'Stopping in ', modname
     1045    WRITE(*, *) 'Reason = ', message
    10461046    CALL getin_dump
    10471047
    1048     if (ierr == 0) then
    1049       write(*, *) 'Everything is cool'
     1048    if (ierr == 0) THEN
     1049      WRITE(*, *) 'Everything is cool'
    10501050    else
    1051       write(*, *) 'Houston, we have a problem ', ierr
     1051      WRITE(*, *) 'Houston, we have a problem ', ierr
    10521052    endif
    10531053    STOP
     
    12961296
    12971297    do l = 1, llm
    1298       if(l==1) then
     1298      IF(l==1) THEN
    12991299        !si omgup pour la couche 1, alors tendance nulle
    13001300        omgdown = max(omega(2), 0.0)
     
    13081308        d_v_va(l) = -omgdown * (v(l) - v(l + 1)) / (play(l) - play(l + 1))
    13091309
    1310       elseif(l==llm) then
     1310      elseif(l==llm) THEN
    13111311        omgup = min(omega(l), 0.0)
    13121312        alpha = rkappa * temp(l) * (1. + q(l, 1) * rv / rd) / (play(l) * (1. + q(l, 1)))
     
    14151415    d_t_va(llm) = -omup * dtdp(llm)!+omup*cor(llm)
    14161416
    1417     !      if(abs(rlat(1))>10.) then
     1417    !      IF(abs(rlat(1))>10.) THEN
    14181418    !     Calculate the tendency due agestrophic motions
    14191419    !      du_age = fcoriolis*(v-vg)
     
    17151715    do l = 1, llm
    17161716
    1717       if (play(l)>=plev_prof_cas(nlev_cas)) then
    1718 
     1717      if (play(l)>=plev_prof_cas(nlev_cas)) THEN
    17191718        mxcalc = l
    17201719        !        print *,'debut interp2, mxcalc=',mxcalc
     
    17221721        k2 = 0
    17231722
    1724         if (play(l)<=plev_prof_cas(1)) then
    1725 
     1723        if (play(l)<=plev_prof_cas(1)) THEN
    17261724          do k = 1, nlev_cas - 1
    1727             if (play(l)<=plev_prof_cas(k).and. play(l)>plev_prof_cas(k + 1)) then
     1725            if (play(l)<=plev_prof_cas(k).and. play(l)>plev_prof_cas(k + 1)) THEN
    17281726              k1 = k
    17291727              k2 = k + 1
     
    17311729          enddo
    17321730
    1733           if (k1==0 .or. k2==0) then
    1734             write(*, *) 'PB! k1, k2 = ', k1, k2
    1735             write(*, *) 'l,play(l) = ', l, play(l) / 100
     1731          if (k1==0 .or. k2==0) THEN
     1732            WRITE(*, *) 'PB! k1, k2 = ', k1, k2
     1733            WRITE(*, *) 'l,play(l) = ', l, play(l) / 100
    17361734            do k = 1, nlev_cas - 1
    1737               write(*, *) 'k,plev_prof_cas(k) = ', k, plev_prof_cas(k) / 100
     1735              WRITE(*, *) 'k,plev_prof_cas(k) = ', k, plev_prof_cas(k) / 100
    17381736            enddo
    17391737          endif
     
    17421740          t_mod_cas(l) = t_prof_cas(k2) - frac * (t_prof_cas(k2) - t_prof_cas(k1))
    17431741          theta_mod_cas(l) = th_prof_cas(k2) - frac * (th_prof_cas(k2) - th_prof_cas(k1))
    1744           if(theta_mod_cas(l)/=0) t_mod_cas(l) = theta_mod_cas(l) * (play(l) / 100000.)**(RD / RCPD)
     1742          IF(theta_mod_cas(l)/=0) t_mod_cas(l) = theta_mod_cas(l) * (play(l) / 100000.)**(RD / RCPD)
    17451743          thv_mod_cas(l) = thv_prof_cas(k2) - frac * (thv_prof_cas(k2) - thv_prof_cas(k1))
    17461744          thl_mod_cas(l) = thl_prof_cas(k2) - frac * (thl_prof_cas(k2) - thl_prof_cas(k1))
     
    17801778          t_mod_cas(l) = frac1 * t_prof_cas(k1) - frac2 * t_prof_cas(k2)
    17811779          theta_mod_cas(l) = frac1 * th_prof_cas(k1) - frac2 * th_prof_cas(k2)
    1782           if(theta_mod_cas(l)/=0) t_mod_cas(l) = theta_mod_cas(l) * (play(l) / 100000.)**(RD / RCPD)
     1780          IF(theta_mod_cas(l)/=0) t_mod_cas(l) = theta_mod_cas(l) * (play(l) / 100000.)**(RD / RCPD)
    17831781          thv_mod_cas(l) = frac1 * thv_prof_cas(k1) - frac2 * thv_prof_cas(k2)
    17841782          thl_mod_cas(l) = frac1 * thl_prof_cas(k1) - frac2 * thl_prof_cas(k2)
     
    18511849    enddo ! l
    18521850
    1853     return
     1851    RETURN
    18541852  end
    18551853
Note: See TracChangeset for help on using the changeset viewer.