Ignore:
Timestamp:
Oct 19, 2023, 4:02:57 PM (8 months ago)
Author:
idelkadi
Message:

Merged trunk changes -r4488:4726 LMDZ_ECRad branch

Location:
LMDZ6/branches/LMDZ_ECRad
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ_ECRad

  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/phys_output_mod.F90

    r4482 r4727  
    4747    USE vertical_layers_mod, ONLY: ap,bp,preff,presnivs, aps, bps, pseudoalt, presinter
    4848    USE time_phylmdz_mod, ONLY: day_ini, itau_phy, start_time, annee_ref, day_ref
    49 #ifdef CPP_XIOS
    5049    ! ug Pour les sorties XIOS
    5150    USE wxios
    52 #endif
    5351
    5452    IMPLICIT NONE
     
    129127    REAL, DIMENSION(klev+1)   :: lev_index
    130128               
    131 #ifdef CPP_XIOS
    132129    ! ug Variables utilis\'ees pour r\'ecup\'erer le calendrier pour xios
    133130    INTEGER :: x_an, x_mois, x_jour
     
    135132    INTEGER :: ini_an, ini_mois, ini_jour
    136133    REAL :: ini_heure
    137 #endif
     134
    138135    INTEGER                         :: ISW
    139136    REAL, DIMENSION(NSW)            :: wl1_sun, wl2_sun !wavelength bounds (in um) for SW
     
    290287     ENDIF
    291288
    292 #ifdef CPP_XIOS
    293     ! ug R\'eglage du calendrier xios
    294     !Temps julian => an, mois, jour, heure
    295     CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure)
    296     CALL ju2ymds(zjulian_start, ini_an, ini_mois, ini_jour, ini_heure)
    297     CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure, ini_an, &
    298                        ini_mois, ini_jour, ini_heure )
    299 #endif
     289    IF (using_xios) THEN
     290      ! ug R\'eglage du calendrier xios
     291      !Temps julian => an, mois, jour, heure
     292      CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure)
     293      CALL ju2ymds(zjulian_start, ini_an, ini_mois, ini_jour, ini_heure)
     294      CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure, ini_an, &
     295                         ini_mois, ini_jour, ini_heure )
     296    ENDIF
    300297
    301298!!!!!!!!!!!!!!!!!!!!!!! Boucle sur les fichiers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    330327
    331328
    332 #ifdef CPP_XIOS
    333 !!! Ouverture de chaque fichier XIOS !!!!!!!!!!!
    334     IF (.not. ok_all_xml) THEN
     329    IF (using_xios) THEN
     330      !!! Ouverture de chaque fichier XIOS !!!!!!!!!!!
     331      IF (.not. ok_all_xml) THEN
     332        IF (prt_level >= 10) THEN
     333         print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff))   
     334        ENDIF
     335        CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) 
     336      ENDIF
     337
     338      !!! Declaration des axes verticaux de chaque fichier:
    335339      IF (prt_level >= 10) THEN
    336         print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff))   
     340        print*,'phys_output_open: Declare vertical axes for each file'
    337341      ENDIF
    338       CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) 
    339     ENDIF
    340 
    341 !!! Declaration des axes verticaux de chaque fichier:
    342     IF (prt_level >= 10) THEN
    343       print*,'phys_output_open: Declare vertical axes for each file'
    344     ENDIF
    345 
    346    IF (iff.LE.6.OR.iff.EQ.10) THEN
    347     CALL wxios_add_vaxis("presnivs", &
    348             levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff)))
    349     CALL wxios_add_vaxis("presinter", &
    350             klev + 1, presinter(1:klev+1))
    351     CALL wxios_add_vaxis("Ahyb", &
    352             levmax(iff) - levmin(iff) + 1, aps(levmin(iff):levmax(iff)), positif='down', &
    353             bnds=Ahyb_bounds(levmin(iff):levmax(iff),:))
    354     CALL wxios_add_vaxis("Bhyb", &
    355             levmax(iff) - levmin(iff) + 1, bps(levmin(iff):levmax(iff)), positif='down', &
    356             bnds=Bhyb_bounds(levmin(iff):levmax(iff),:))
    357     CALL wxios_add_vaxis("klev", levmax(iff) - levmin(iff) + 1, &
    358                           lev_index(levmin(iff):levmax(iff)))
    359     CALL wxios_add_vaxis("klevp1", klev+1, &
    360                           lev_index(1:klev+1))
    361     CALL wxios_add_vaxis("bnds", 2, (/1.,2./))
    362 
    363     CALL wxios_add_vaxis("Alt", &
    364             levmax(iff) - levmin(iff) + 1, pseudoalt)
    365 
    366     ! wl1_sun/wl2_sun: minimum/maximum bound of wavelength (in um)
    367     SELECT CASE(NSW)
    368       CASE(6)
    369         wl1_sun(1:6) = [0.180, 0.250, 0.440, 0.690, 1.190, 2.380]
    370         wl2_sun(1:6) = [0.250, 0.440, 0.690, 1.190, 2.380, 4.000]
    371       CASE(2)
    372         wl1_sun(1:2) = [0.250, 0.690]
    373         wl2_sun(1:2) = [0.690, 4.000]
    374     END SELECT
    375 
    376     DO ISW=1, NSW
    377      wn1_sun(ISW)=1.e+6/wl1_sun(ISW)
    378      wn2_sun(ISW)=1.e+6/wl2_sun(ISW)
    379      spbnds_sun(ISW,1)=wn2_sun(ISW)
    380      spbnds_sun(ISW,2)=wn1_sun(ISW)
    381      spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2
    382     ENDDO
     342
     343      IF (iff.LE.6.OR.iff.EQ.10) THEN
     344        CALL wxios_add_vaxis("presnivs", &
     345              levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff)))
     346        CALL wxios_add_vaxis("presinter", &
     347              klev + 1, presinter(1:klev+1))
     348        CALL wxios_add_vaxis("Ahyb", &
     349              levmax(iff) - levmin(iff) + 1, aps(levmin(iff):levmax(iff)), positif='down', &
     350              bnds=Ahyb_bounds(levmin(iff):levmax(iff),:))
     351        CALL wxios_add_vaxis("Bhyb", &
     352              levmax(iff) - levmin(iff) + 1, bps(levmin(iff):levmax(iff)), positif='down', &
     353              bnds=Bhyb_bounds(levmin(iff):levmax(iff),:))
     354        CALL wxios_add_vaxis("klev", levmax(iff) - levmin(iff) + 1, &
     355                              lev_index(levmin(iff):levmax(iff)))
     356        CALL wxios_add_vaxis("klevp1", klev+1, &
     357                              lev_index(1:klev+1))
     358        CALL wxios_add_vaxis("bnds", 2, (/1.,2./))
     359 
     360        CALL wxios_add_vaxis("Alt", &
     361                levmax(iff) - levmin(iff) + 1, pseudoalt)
     362
     363        ! wl1_sun/wl2_sun: minimum/maximum bound of wavelength (in um)
     364        SELECT CASE(NSW)
     365          CASE(6)
     366            wl1_sun(1:6) = [0.180, 0.250, 0.440, 0.690, 1.190, 2.380]
     367            wl2_sun(1:6) = [0.250, 0.440, 0.690, 1.190, 2.380, 4.000]
     368          CASE(2)
     369            wl1_sun(1:2) = [0.250, 0.690]
     370            wl2_sun(1:2) = [0.690, 4.000]
     371        END SELECT
     372
     373        DO ISW=1, NSW
     374          wn1_sun(ISW)=1.e+6/wl1_sun(ISW)
     375          wn2_sun(ISW)=1.e+6/wl2_sun(ISW)
     376          spbnds_sun(ISW,1)=wn2_sun(ISW)
     377          spbnds_sun(ISW,2)=wn1_sun(ISW)
     378          spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2
     379        ENDDO
    383380!
    384381!!! ajout axe vertical spectband : solar band number
    385     CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down')
    386    ELSE
    387     ! NMC files
    388     CALL wxios_add_vaxis("plev", &
    389             levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff)))
    390    ENDIF
    391 #endif
     382        CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down')
     383      ELSE
     384        ! NMC files
     385        CALL wxios_add_vaxis("plev", &
     386                levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff)))
     387      ENDIF
     388    ENDIF !using_xios
    392389
    393390        IF (clef_files(iff)) THEN
Note: See TracChangeset for help on using the changeset viewer.