Ignore:
Timestamp:
Jul 23, 2024, 3:29:36 PM (8 weeks ago)
Author:
abarral
Message:

Handle CPP_INLANDSIS in lmdz_cppkeys_wrapper.F90
Remove obsolete key wrgrads_thermcell, _ADV_HALO, _ADV_HALLO, isminmax
Remove redundant uses of CPPKEY_INCA (thanks acozic)
Remove obsolete misc/write_field.F90
Remove unused ioipsl_* wrappers
Remove calls to WriteField_u with wrong signature
Convert .F -> .[fF]90
(lint) uppercase fortran operators
[note: 1d and iso still broken - working on it]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_main.F90

    r5101 r5103  
    77CONTAINS
    88
    9       subroutine thermcell_main(itap,ngrid,nlay,ptimestep  &
     9      SUBROUTINE thermcell_main(itap,ngrid,nlay,ptimestep  &
    1010                    ,pplay,pplev,pphi,debut  &
    1111                    ,puwind,pvwind,ptemp,p_o,ptemp_env, po_env  &
     
    185185   fm=0. ; entr=0. ; detr=0.
    186186
    187       if (prt_level>=1) print*,'thermcell_main V4'
    188 
    189        sorties=.true.
     187      if (prt_level>=1) PRINT*,'thermcell_main V4'
     188
     189       sorties=.TRUE.
    190190      IF(ngrid/=ngrid) THEN
    191191         PRINT*
     
    195195      ENDIF
    196196
    197 !print*,'thermcell_main debut'
     197!PRINT*,'thermcell_main debut'
    198198!     write(lunout,*)'WARNING thermcell_main f0=max(f0,1.e-2)'
    199199     do ig=1,ngrid
     
    205205      if (prt_level>=20) then
    206206       do ig=1,ngrid
    207           print*,'th_main ig f0',ig,f0(ig)
     207          PRINT*,'th_main ig f0',ig,f0(ig)
    208208       enddo
    209209      endif
     
    238238        !    SUBROUTINE thermcell_env(ngrid,nlay,po,pt,pu,pv,pplay,  &
    239239        ! &           pplev,zo,zh,zl,ztv,zthl,zu,zv,zpspsk,pqsat,lev_out)
    240         ! contenu thermcell_env : call thermcell_qsat(ngrid*nlay,mask,pplev,pt,po,pqsat)
     240        ! contenu thermcell_env : CALL thermcell_qsat(ngrid*nlay,mask,pplev,pt,po,pqsat)
    241241        ! contenu thermcell_env : do ll=1,nlay
    242242        ! contenu thermcell_env :    do ig=1,ngrid
     
    267267                 ztv(ig,l)=ztv(ig,l)*(1.+RETV*po_env(ig,l))
    268268                 zthl(ig,l)=ptemp(ig,l)/zpspsk(ig,l)
    269                  mask(ig,l)=.true.
     269                 mask(ig,l)=.TRUE.
    270270            enddo
    271271        enddo
    272         call thermcell_qsat(ngrid*nlay,mask,pplev,ptemp_env,p_o,zqsat)
     272        CALL thermcell_qsat(ngrid*nlay,mask,pplev,ptemp_env,p_o,zqsat)
    273273         
    274274      endif
    275275       
    276       if (prt_level>=1) print*,'thermcell_main apres thermcell_env'
     276      if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_env'
    277277
    278278!------------------------------------------------------------------------
     
    322322         masse(:,l)=(pplev(:,l)-pplev(:,l+1))/RG
    323323      enddo
    324       if (prt_level>=1) print*,'thermcell_main apres initialisation'
     324      if (prt_level>=1) PRINT*,'thermcell_main apres initialisation'
    325325
    326326!------------------------------------------------------------------
     
    395395!--------------------------------------------------------------------------------
    396396
    397       if (prt_level>=1) print*,'avant thermcell_plume ',lev_out
     397      if (prt_level>=1) PRINT*,'avant thermcell_plume ',lev_out
    398398
    399399!=====================================================================
     
    412412
    413413      if (iflag_thermals_ed<=9) then
    414 !         print*,'THERM NOUVELLE/NOUVELLE Arnaud'
     414!         PRINT*,'THERM NOUVELLE/NOUVELLE Arnaud'
    415415         CALL thermcell_plume_6A(itap,ngrid,nlay,ptimestep,ztv,zthl,p_o,zl,rhobarz,&
    416416      zlev,pplev,pphi,zpspsk,alim_star,alim_star_tot,  &
     
    420420
    421421      elseif (iflag_thermals_ed<=19) then
    422 !        print*,'THERM RIO et al 2010, version d Arnaud'
     422!        PRINT*,'THERM RIO et al 2010, version d Arnaud'
    423423         CALL thermcell_plume_5B(itap,ngrid,nlay,ptimestep,ztv,zthl,p_o,zl,rhobarz,&
    424424      zlev,pplev,pphi,zpspsk,alim_star,alim_star_tot,  &
     
    434434      endif
    435435
    436       if (prt_level>=1) print*,'apres thermcell_plume ',lev_out
    437 
    438       call test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_plum lalim ')
    439       call test_ltherm(ngrid,nlay,pplay,lmix ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_plum lmix  ')
    440 
    441       if (prt_level>=1) print*,'thermcell_main apres thermcell_plume'
     436      if (prt_level>=1) PRINT*,'apres thermcell_plume ',lev_out
     437
     438      CALL test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_plum lalim ')
     439      CALL test_ltherm(ngrid,nlay,pplay,lmix ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_plum lmix  ')
     440
     441      if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_plume'
    442442      if (prt_level>=10) then
    443443         write(lunout1,*) 'Dans thermcell_main 2'
     
    461461         wmax_tmp(:)=max(wmax_tmp(:),zw2(:,l))
    462462      enddo
    463 !     print*,"ZMAX ",lalim,lmin,linter,lmix,lmax,zmax,zmax0,zmix,wmax
    464 
    465 
    466 
    467       call test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lalim ')
    468       call test_ltherm(ngrid,nlay,pplay,lmin ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmin  ')
    469       call test_ltherm(ngrid,nlay,pplay,lmix ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmix  ')
    470       call test_ltherm(ngrid,nlay,pplay,lmax ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmax  ')
    471 
    472       if (prt_level>=1) print*,'thermcell_main apres thermcell_height'
     463!     PRINT*,"ZMAX ",lalim,lmin,linter,lmix,lmax,zmax,zmax0,zmix,wmax
     464
     465
     466
     467      CALL test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lalim ')
     468      CALL test_ltherm(ngrid,nlay,pplay,lmin ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmin  ')
     469      CALL test_ltherm(ngrid,nlay,pplay,lmix ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmix  ')
     470      CALL test_ltherm(ngrid,nlay,pplay,lmax ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmax  ')
     471
     472      if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_height'
    473473
    474474!-------------------------------------------------------------------------------
     
    481481
    482482 
    483 call test_ltherm(ngrid,nlay,pplay,lmin,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_dry  lmin  ')
    484 call test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_dry  lalim ')
    485 
    486       if (prt_level>=1) print*,'thermcell_main apres thermcell_dry'
     483CALL test_ltherm(ngrid,nlay,pplay,lmin,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_dry  lmin  ')
     484CALL test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_dry  lalim ')
     485
     486      if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_dry'
    487487      if (prt_level>=10) then
    488488         write(lunout1,*) 'Dans thermcell_main 1b'
     
    521521!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    522522
    523       if(prt_level>=1)print*,'thermcell_closure apres thermcell_closure'
     523      if(prt_level>=1)PRINT*,'thermcell_closure apres thermcell_closure'
    524524
    525525      if (tau_thermals>1.) then
     
    546546!IM 060508    &       detr,zqla,zmax,lev_out,lunout,igout)
    547547
    548       if (prt_level>=1) print*,'thermcell_main apres thermcell_flux'
    549       call test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_flux lalim ')
    550       call test_ltherm(ngrid,nlay,pplay,lmax ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_flux lmax  ')
     548      if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_flux'
     549      CALL test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_flux lalim ')
     550      CALL test_ltherm(ngrid,nlay,pplay,lmax ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_flux lmax  ')
    551551
    552552!------------------------------------------------------------------
     
    588588!------------------------------------------------------------------
    589589      IF (iflag_thermals_down > 0) THEN
    590         if (debut) print*,'WARNING !!! routine thermcell_down en cours de developpement'
     590        if (debut) PRINT*,'WARNING !!! routine thermcell_down en cours de developpement'
    591591        entrdn=fact_thermals_down*detr0
    592592        detrdn=fact_thermals_down*entr0
     
    605605           enddo
    606606        enddo
    607         call thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse,  &
     607        CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse,  &
    608608                      zthl,zdthladj,zta,lev_out)
    609609
     
    613613           enddo
    614614        enddo
    615         call thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse,  &
     615        CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse,  &
    616616                     z_o,pdoadj,z_oa,lev_out)
    617617
     
    625625            enddo
    626626          enddo
    627           call thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse,  &
     627          CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse,  &
    628628                     xtpo_tmp,xtpdoadj_tmp,xtzo_tmp,lev_out)
    629629          do ll=1,nlay
     
    640640        DO ig=1,ngrid
    641641          if (iso_eau.gt.0) then
    642               call iso_verif_egalite(xtpo(iso_eau,ig,ll), &
     642              CALL iso_verif_egalite(xtpo(iso_eau,ig,ll), &
    643643            p_o(ig,ll),'thermcell_main 594')
    644               call iso_verif_egalite(xtpdoadj(iso_eau,ig,ll), &
     644              CALL iso_verif_egalite(xtpdoadj(iso_eau,ig,ll), &
    645645            pdoadj(ig,ll),'thermcell_main 596')
    646646          endif
    647647          if (iso_HDO.gt.0) then
    648               call iso_verif_aberrant_encadre(xtpo(iso_hdo,ig,ll) &
     648              CALL iso_verif_aberrant_encadre(xtpo(iso_hdo,ig,ll) &
    649649             /p_o(ig,ll),'thermcell_main 610')
    650650          endif
     
    666666! de pression horizontal avec l'environnement
    667667
    668          call thermcell_dv2(ngrid,nlay,ptimestep,fm0,entr0,masse  &
     668         CALL thermcell_dv2(ngrid,nlay,ptimestep,fm0,entr0,masse  &
    669669!    &    ,fraca*dvdq,zmax &
    670670      ,fraca,zmax &
     
    674674
    675675! calcul purement conservatif pour le transport de V
    676          call thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse  &
     676         CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse  &
    677677      ,zu,pduadj,zua,lev_out)
    678          call thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse  &
     678         CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse  &
    679679      ,zv,pdvadj,zva,lev_out)
    680680
     
    682682    ENDIF
    683683
    684 !     print*,'13 OK convect8'
     684!     PRINT*,'13 OK convect8'
    685685      do l=1,nlay
    686686         do ig=1,ngrid
     
    689689      enddo
    690690
    691       if (prt_level>=1) print*,'14 OK convect8'
     691      if (prt_level>=1) PRINT*,'14 OK convect8'
    692692!------------------------------------------------------------------
    693693!   Calculs de diagnostiques pour les sorties
     
    696696     
    697697      if (sorties) then
    698       if (prt_level>=1) print*,'14a OK convect8'
     698      if (prt_level>=1) PRINT*,'14a OK convect8'
    699699! calcul du niveau de condensation
    700700! initialisation
     
    731731!      endif
    732732
    733       if (prt_level>=1) print*,'14b OK convect8'
     733      if (prt_level>=1) PRINT*,'14b OK convect8'
    734734      do k=nlay,1,-1
    735735         do ig=1,ngrid
     
    740740         enddo
    741741      enddo
    742       if (prt_level>=1) print*,'14c OK convect8'
     742      if (prt_level>=1) PRINT*,'14c OK convect8'
    743743!calcul des moments
    744744!initialisation
     
    752752         enddo
    753753      enddo     
    754       if (prt_level>=1) print*,'14d OK convect8'
     754      if (prt_level>=1) PRINT*,'14d OK convect8'
    755755      if (prt_level>=10)write(lunout,*)                                &
    756756       'WARNING thermcell_main wth2=0. si zw2 > 1.e-10'
     
    783783
    784784!calcul du ratqscdiff
    785       if (prt_level>=1) print*,'14e OK convect8'
     785      if (prt_level>=1) PRINT*,'14e OK convect8'
    786786      var=0.
    787787      vardiff=0.
     
    796796      enddo
    797797
    798       if (prt_level>=1) print*,'14f OK convect8'
     798      if (prt_level>=1) PRINT*,'14f OK convect8'
    799799
    800800      do l=1,nlay
     
    808808      enddo
    809809
    810       if (prt_level>=1) print*,'14g OK convect8'
     810      if (prt_level>=1) PRINT*,'14g OK convect8'
    811811         do l=1,nlay
    812812            do ig=1,ngrid
     
    816816      endif
    817817
    818       if (prt_level>=1) print*,'thermcell_main FIN  OK'
    819 
    820 !print*,'thermcell_main fin'
     818      if (prt_level>=1) PRINT*,'thermcell_main FIN  OK'
     819
     820!PRINT*,'thermcell_main fin'
    821821 RETURN
    822       end subroutine thermcell_main
     822      END SUBROUTINE thermcell_main
    823823
    824824!=============================================================================
    825825!/////////////////////////////////////////////////////////////////////////////
    826826!=============================================================================
    827       subroutine test_ltherm(ngrid,nlay,pplay,long,ztv,p_o,ztva, &  ! in
     827      SUBROUTINE test_ltherm(ngrid,nlay,pplay,long,ztv,p_o,ztva, &  ! in
    828828              zqla,f_star,zw2,comment)                          ! in
    829829!=============================================================================
     
    841841
    842842      if (prt_level>=1) THEN
    843        print*,'WARNING !!! TEST ',comment
     843       PRINT*,'WARNING !!! TEST ',comment
    844844      endif
    845845      return
     
    849849!IMtemp           if (pplay(i,long(i)).lt.seuil*pplev(i,1)) then
    850850           if (prt_level>=10) then
    851                print*,'WARNING ',comment,' au point ',i,' K= ',long(i)
    852                print*,'  K  P(MB)  THV(K)     Qenv(g/kg)THVA        QLA(g/kg)   F*        W2'
     851               PRINT*,'WARNING ',comment,' au point ',i,' K= ',long(i)
     852               PRINT*,'  K  P(MB)  THV(K)     Qenv(g/kg)THVA        QLA(g/kg)   F*        W2'
    853853               do k=1,nlay
    854854                  write(6,'(i3,7f10.3)') k,pplay(i,k),ztv(i,k),1000*p_o(i,k),ztva(i,k),1000*zqla(i,k),f_star(i,k),zw2(i,k)
     
    863863! nrlmd le 10/04/2012   Transport de la TKE par le thermique moyen pour la fermeture en ALP
    864864!                       On transporte pbl_tke pour donner therm_tke
    865 !                       Copie conforme de la subroutine DTKE dans physiq.F ecrite par Frederic Hourdin
     865!                       Copie conforme de la SUBROUTINE DTKE dans physiq.F ecrite par Frederic Hourdin
    866866
    867867!=======================================================================
     
    869869!=======================================================================
    870870
    871       subroutine thermcell_tke_transport( &
     871      SUBROUTINE thermcell_tke_transport( &
    872872       ngrid,nlay,ptimestep,fm0,entr0,rg,pplev,  &   ! in
    873873       therm_tke_max)                                ! out
     
    905905
    906906
    907       if (prt_level>=1) print*,'Q2 THERMCEL_DQ 0'
     907      if (prt_level>=1) PRINT*,'Q2 THERMCEL_DQ 0'
    908908
    909909!   calcul du detrainement
     
    946946            endif
    947947            if (qa(ig,k)<0.) then
    948 !               print*,'qa<0!!!'
     948!               PRINT*,'qa<0!!!'
    949949            endif
    950950            if (q(ig,k)<0.) then
    951 !               print*,'q<0!!!'
     951!               PRINT*,'q<0!!!'
    952952            endif
    953953         enddo
     
    960960            wqd(ig,k)=fm(ig,k)*q(ig,k)
    961961            if (wqd(ig,k)<0.) then
    962 !               print*,'wqd<0!!!'
     962!               PRINT*,'wqd<0!!!'
    963963            endif
    964964         enddo
Note: See TracChangeset for help on using the changeset viewer.