Ignore:
Timestamp:
Jul 31, 2024, 9:54:47 PM (6 months ago)
Author:
abarral
Message:

Fix ecrad & rrtm compilation

File:
1 edited

Legend:

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

    r5133 r5154  
    33!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    44   MODULE cosp_output_write_mod
    5  
     5
    66   USE cosp_output_mod
    7  
     7
    88   IMPLICIT NONE
    99
     
    2828    USE wxios, only: wxios_closedef
    2929    USE lmdz_xios, only: xios_update_calendar, xios_field_is_active, using_xios
    30   IMPLICIT NONE 
     30  IMPLICIT NONE
    3131!!! Variables d'entree
    3232  integer               :: itap, Nlevlmdz, Ncolumns, Npoints
     
    6767       itau_wcosp = itau_phy + itap + start_time * day_step_phy
    6868        if (prt_level >= 10) then
    69              WRITE(lunout,*)'itau_wcosp, itap, start_time, day_step_phy =', & 
     69             WRITE(lunout,*)'itau_wcosp, itap, start_time, day_step_phy =', &
    7070                             itau_wcosp, itap, start_time, day_step_phy
    7171        endif
     
    7878
    7979    ok_sync = .TRUE.
    80    
     80
    8181!DO iinit=1, iinitend
    8282! AI sept 2014 cette boucle supprimee
     
    9393!         WRITE(lunout,*)'Apell xios_update_calendar cosp_varsdefined iinitend ', &
    9494!                         cosp_varsdefined,iinitend
    95 !   endif 
     95!   endif
    9696!    CALL xios_update_calendar(itau_wcosp)
    9797!ENDIF
     
    102102!!!! Sorties Calipso
    103103 if (cfg%Llidar_sim) then
    104 !!! AI 02 2018 
     104!!! AI 02 2018
    105105! Traitement missing_val
    106106   where(stlidar%lidarcld == R_UNDEF) stlidar%lidarcld = missing_val
    107    where(stlidar%proftemp == R_UNDEF) stlidar%proftemp = missing_val   !TIBO 
     107   where(stlidar%proftemp == R_UNDEF) stlidar%proftemp = missing_val   !TIBO
    108108   where(stlidar%profSR == R_UNDEF) stlidar%profSR = missing_val       !TIBO2
    109    where(sglidar%beta_mol == R_UNDEF) sglidar%beta_mol = missing_val 
    110    where(sglidar%beta_tot == R_UNDEF) sglidar%beta_tot = missing_val 
     109   where(sglidar%beta_mol == R_UNDEF) sglidar%beta_mol = missing_val
     110   where(sglidar%beta_tot == R_UNDEF) sglidar%beta_tot = missing_val
    111111   where(stlidar%cldlayer == R_UNDEF) stlidar%cldlayer = missing_val
    112112   where(stlidar%cldtype == R_UNDEF) stlidar%cldtype = missing_val     !OPAQ
     
    119119   where(stlidar%lidarcldtype == R_UNDEF) stlidar%lidarcldtype = missing_val   !OPAQ
    120120   where(stlidar%lidarcldtmp == R_UNDEF) stlidar%lidarcldtmp = missing_val
    121  
     121
    122122!   print*,'Appel histwrite2d_cosp'
    123123   if (cfg%Lcllcalipso) CALL histwrite2d_cosp(o_cllcalipso,stlidar%cldlayer(:,1))
    124124   if (cfg%Lclhcalipso) CALL histwrite2d_cosp(o_clhcalipso,stlidar%cldlayer(:,3))
    125    if (cfg%Lclmcalipso) CALL histwrite2d_cosp(o_clmcalipso,stlidar%cldlayer(:,2)) 
     125   if (cfg%Lclmcalipso) CALL histwrite2d_cosp(o_clmcalipso,stlidar%cldlayer(:,2))
    126126   if (cfg%Lcltcalipso) CALL histwrite2d_cosp(o_cltcalipso,stlidar%cldlayer(:,4))
    127127   if (cfg%Lclcalipso) CALL histwrite3d_cosp(o_clcalipso,stlidar%lidarcld,nvert)
     
    182182   if (cfg%LparasolRefl) CALL histwrite3d_cosp(o_parasol_refl,stlidar%parasolrefl,nvertp)
    183183
    184   if (cfg%LparasolRefl) then 
     184  if (cfg%LparasolRefl) then
    185185    do k=1,PARASOL_NREFL
    186186     do ip=1, Npoints
     
    202202     if (cfg%Latb532) CALL histwrite4d_cosp(o_atb532,sglidar%beta_tot)
    203203   ELSE
    204      if (cfg%Latb532) then 
    205        do icl=1,Ncolumns 
     204     if (cfg%Latb532) then
     205       do icl=1,Ncolumns
    206206          CALL histwrite3d_cosp(o_atb532,sglidar%beta_tot(:,icl,:),nvertmcosp,icl)
    207207       enddo
    208      endif 
     208     endif
    209209   ENDIF
    210210
    211    if (cfg%LlidarBetaMol532) CALL histwrite3d_cosp(o_beta_mol532,sglidar%beta_mol,nvertmcosp) 
     211   if (cfg%LlidarBetaMol532) CALL histwrite3d_cosp(o_beta_mol532,sglidar%beta_mol,nvertmcosp)
    212212
    213213 endif !Lidar
     
    259259  where(isccp%fq_isccp == R_UNDEF) isccp%fq_isccp = missing_val
    260260  where(isccp%boxtau == R_UNDEF) isccp%boxtau = missing_val
    261   where(isccp%boxptop == R_UNDEF) isccp%boxptop = missing_val 
     261  where(isccp%boxptop == R_UNDEF) isccp%boxptop = missing_val
    262262
    263263   CALL histwrite2d_cosp(o_sunlit,gbx%sunlit)
     
    267267     if (cfg%Lclisccp) then
    268268       do icl=1,7
    269          CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl) 
     269         CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl)
    270270       enddo
    271271     endif
     
    273273
    274274   if (cfg%Lboxtauisccp) CALL histwrite3d_cosp(o_boxtauisccp,isccp%boxtau,nvertcol)
    275    if (cfg%Lboxptopisccp) CALL histwrite3d_cosp(o_boxptopisccp,isccp%boxptop,nvertcol) 
    276    if (cfg%Lcltisccp) CALL histwrite2d_cosp(o_tclisccp,isccp%totalcldarea) 
    277    if (cfg%Lpctisccp) CALL histwrite2d_cosp(o_ctpisccp,isccp%meanptop) 
    278    if (cfg%Ltauisccp) CALL histwrite2d_cosp(o_tauisccp,isccp%meantaucld) 
    279    if (cfg%Lalbisccp) CALL histwrite2d_cosp(o_albisccp,isccp%meanalbedocld) 
    280    if (cfg%Lmeantbisccp) CALL histwrite2d_cosp(o_meantbisccp,isccp%meantb) 
     275   if (cfg%Lboxptopisccp) CALL histwrite3d_cosp(o_boxptopisccp,isccp%boxptop,nvertcol)
     276   if (cfg%Lcltisccp) CALL histwrite2d_cosp(o_tclisccp,isccp%totalcldarea)
     277   if (cfg%Lpctisccp) CALL histwrite2d_cosp(o_ctpisccp,isccp%meanptop)
     278   if (cfg%Ltauisccp) CALL histwrite2d_cosp(o_tauisccp,isccp%meantaucld)
     279   if (cfg%Lalbisccp) CALL histwrite2d_cosp(o_albisccp,isccp%meanalbedocld)
     280   if (cfg%Lmeantbisccp) CALL histwrite2d_cosp(o_meantbisccp,isccp%meantb)
    281281   if (cfg%Lmeantbclrisccp) CALL histwrite2d_cosp(o_meantbclrisccp,isccp%meantbclr)
    282282 endif ! Isccp
     
    294294   ELSE
    295295     if (cfg%LclMISR) then
    296       do icl=1,7 
     296      do icl=1,7
    297297        CALL histwrite3d_cosp(o_clMISR,misr%fq_MISR(:,icl,:),nvertmisr,icl)
    298298      enddo
     
    329329        modis%Cloud_Top_Pressure_Total_Mean = missing_val
    330330  where(modis%Liquid_Water_Path_Mean == R_UNDEF) &
    331         modis%Liquid_Water_Path_Mean = missing_val 
     331        modis%Liquid_Water_Path_Mean = missing_val
    332332  where(modis%Ice_Water_Path_Mean == R_UNDEF) &
    333333        modis%Ice_Water_Path_Mean = missing_val
     
    335335  where(modis%Optical_Thickness_Total_LogMean == R_UNDEF) &
    336336          modis%Optical_Thickness_Total_LogMean = missing_val
    337            
     337
    338338  where(modis%Optical_Thickness_Water_LogMean == R_UNDEF) &
    339339          modis%Optical_Thickness_Water_LogMean = missing_val
     
    341341  where(modis%Optical_Thickness_Ice_LogMean == R_UNDEF) &
    342342          modis%Optical_Thickness_Ice_LogMean = missing_val
    343    
     343
    344344  if (cfg%Lcllmodis) CALL histwrite2d_cosp(o_cllmodis,modis%Cloud_Fraction_Low_Mean)
    345345  if (cfg%Lclhmodis) CALL histwrite2d_cosp(o_clhmodis,modis%Cloud_Fraction_High_Mean)
     
    351351  if (cfg%Ltauwmodis) CALL histwrite2d_cosp(o_tauwmodis,modis%Optical_Thickness_Water_Mean)
    352352  if (cfg%Ltauimodis) CALL histwrite2d_cosp(o_tauimodis,modis%Optical_Thickness_Ice_Mean)
    353   if (cfg%Ltautlogmodis) CALL histwrite2d_cosp(o_tautlogmodis,modis%Optical_Thickness_Total_LogMean) 
     353  if (cfg%Ltautlogmodis) CALL histwrite2d_cosp(o_tautlogmodis,modis%Optical_Thickness_Total_LogMean)
    354354  if (cfg%Ltauwlogmodis) CALL histwrite2d_cosp(o_tauwlogmodis,modis%Optical_Thickness_Water_LogMean)
    355355  if (cfg%Ltauilogmodis) CALL histwrite2d_cosp(o_tauilogmodis,modis%Optical_Thickness_Ice_LogMean)
     
    369369       do icl=1,7
    370370         CALL histwrite3d_cosp(o_clmodis, &
    371          modis%Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl)           
     371         modis%Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl)
    372372       enddo
    373       endif 
     373      endif
    374374   ENDIF
    375375
     
    391391     endif
    392392     if (cfg%Lcrlmodis) then
    393        do icl=1,7 
     393       do icl=1,7
    394394         CALL histwrite3d_cosp(o_crlmodis, &
    395395            modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl)
    396396       enddo
    397      endif 
     397     endif
    398398   ENDIF
    399399 endif !modis
     
    445445    USE lmdz_print_control, ONLY: lunout,prt_level
    446446    USE wxios
     447    USE lmdz_clesphys
    447448
    448449    IMPLICIT NONE
    449 
    450     INCLUDE "clesphys.h"
    451450
    452451    INTEGER                          :: iff
     
    480479        IF ( var%cles(iff) ) THEN
    481480          if (prt_level >= 10) then
    482             WRITE(lunout,*)'Appel wxios_add_field_to_file var%name =',var%name 
     481            WRITE(lunout,*)'Appel wxios_add_field_to_file var%name =',var%name
    483482          endif
    484483          CALL wxios_add_field_to_file(var%name, 2, cosp_nidfiles(iff), cosp_outfilenames(iff), &
     
    506505    USE lmdz_print_control, ONLY: lunout,prt_level
    507506    USE wxios
     507    USE lmdz_clesphys
    508508
    509509    IMPLICIT NONE
    510 
    511     INCLUDE "clesphys.h"
    512510
    513511    INTEGER                        :: iff, klevs
     
    582580        IF ( var%cles(iff) ) THEN
    583581          if (prt_level >= 10) then
    584               WRITE(lunout,*)'Appel wxios_add_field_to_file 3d nom variable nam_axvert = ',nom, nam_axvert 
     582              WRITE(lunout,*)'Appel wxios_add_field_to_file 3d nom variable nam_axvert = ',nom, nam_axvert
    585583          endif
    586584          CALL wxios_add_field_to_file(nom, 3, cosp_nidfiles(iff), cosp_outfilenames(iff), &
     
    610608  USE lmdz_xios, only: xios_send_field, using_xios
    611609  USE lmdz_abort_physic, ONLY: abort_physic
     610  USE lmdz_clesphys
    612611
    613612  IMPLICIT NONE
    614   INCLUDE 'clesphys.h'
    615613
    616614    TYPE(ctrl_outcosp), INTENT(IN) :: var
     
    643641    !Et sinon on.... écrit
    644642    IF (SIZE(field)/=klon) &
    645   CALL abort_physic('iophy::histwrite2d_cosp','Field first DIMENSION not equal to klon',1) 
     643  CALL abort_physic('iophy::histwrite2d_cosp','Field first DIMENSION not equal to klon',1)
    646644
    647645    CALL Gather_omp(field,buffer_omp)
     
    655653                ALLOCATE(index2d(nbp_lon*jj_nb))
    656654#ifndef CPP_IOIPSL_NO_OUTPUT
    657         CALL histwrite(cosp_nidfiles(iff),var%name,itau_iocosp,Field2d,nbp_lon*jj_nb,index2d) 
     655        CALL histwrite(cosp_nidfiles(iff),var%name,itau_iocosp,Field2d,nbp_lon*jj_nb,index2d)
    658656#endif
    659657            deallocate(index2d)
     
    670668            ENDIF
    671669          ENDIF
    672       ENDDO 
     670      ENDDO
    673671
    674672    IF (using_xios) THEN
     
    681679    ENDIF
    682680
    683 !$OMP END MASTER   
     681!$OMP END MASTER
    684682  ENDIF ! vars_defined
    685683  IF (prt_level >= 9) WRITE(lunout,*)'End histrwrite2d_cosp ',var%name
     
    697695  USE lmdz_xios, only: xios_send_field, using_xios
    698696  USE lmdz_abort_physic, ONLY: abort_physic
     697  USE lmdz_clesphys
    699698
    700699  IMPLICIT NONE
    701   INCLUDE 'clesphys.h'
    702700
    703701    TYPE(ctrl_outcosp), INTENT(IN)    :: var
     
    741739    !Et sinon on.... écrit
    742740    IF (SIZE(field,1)/=klon) &
    743    CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)                                 
     741   CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)
    744742    nlev=SIZE(field,2)
    745743
     
    755753           ALLOCATE(index3d(nbp_lon*jj_nb*nlev))
    756754#ifndef CPP_IOIPSL_NO_OUTPUT
    757     CALL histwrite(cosp_nidfiles(iff),nom,itau_iocosp,Field3d,nbp_lon*jj_nb*nlev,index3d) 
     755    CALL histwrite(cosp_nidfiles(iff),nom,itau_iocosp,Field3d,nbp_lon*jj_nb*nlev,index3d)
    758756#endif
    759757
     
    778776  ENDIF
    779777
    780 !$OMP END MASTER   
     778!$OMP END MASTER
    781779  ENDIF ! vars_defined
    782780  IF (prt_level >= 9) write(lunout,*)'End histrwrite3d_cosp ',nom
     
    794792  USE lmdz_xios, only: xios_send_field, using_xios
    795793  USE lmdz_abort_physic, ONLY: abort_physic
     794  USE lmdz_clesphys
    796795
    797796  IMPLICIT NONE
    798   INCLUDE 'clesphys.h'
    799797
    800798    TYPE(ctrl_outcosp), INTENT(IN)    :: var
     
    814812    !Et sinon on.... écrit
    815813    IF (SIZE(field,1)/=klon) &
    816    CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)           
     814   CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)
    817815
    818816    nlev=SIZE(field,2)
     
    829827   ENDIF
    830828
    831 !$OMP END MASTER   
     829!$OMP END MASTER
    832830  ENDIF ! vars_defined
    833831  IF (prt_level >= 9) write(lunout,*)'End histrwrite4d_cosp ',nom
Note: See TracChangeset for help on using the changeset viewer.