Changeset 4146


Ignore:
Timestamp:
May 10, 2022, 6:50:43 PM (2 years ago)
Author:
Laurent Fairhead
Message:

Source code and xml files needed for XIOS output in the LMDZ LonLat? dynamical core.
One flag controls everything: ok_dyn_xios. Parameters controlling outputs need to be put in the xml
files, nothing is set in the code
Work to follow on the dynzon file and the modipsl/libIGCM framework.
ok_dyn_xios = n should not change anything

Location:
LMDZ6/trunk
Files:
8 added
7 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/dyn3d_common/control_mod.F90

    r2083 r4146  
    3838  LOGICAL,SAVE :: ok_dyn_ave ! output averaged values of fields in the dynamics
    3939                             ! in NetCDF files dyn_hist*ave.nc
     40  LOGICAL,SAVE :: ok_dyn_xios ! xios outputs in dynamics
    4041  LOGICAL,SAVE :: resetvarc  ! allows to reset the variables in sortvarc
    4142
  • LMDZ6/trunk/libf/dyn3dmem/conf_gcm.F90

    r4100 r4146  
    678678     ok_dyn_ave = .FALSE.
    679679     CALL getin('ok_dyn_ave',ok_dyn_ave)
     680
     681     !Config  Key  = ok_dyn_xios
     682     !Config  Desc = sorties moyennes dans la dynamique
     683     !Config  Def  = n
     684     !Config  Help =
     685     !Config         
     686     ok_dyn_xios = .FALSE.
     687     CALL getin('ok_dyn_xios',ok_dyn_xios)
    680688
    681689     write(lunout,*)' #########################################'
     
    721729     write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins
    722730     write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave
     731     write(lunout,*)' ok_dyn_xios = ', ok_dyn_xios
    723732  else
    724733     !Config  Key  = clon
     
    880889     ok_dyn_ave = .FALSE.
    881890     CALL getin('ok_dyn_ave',ok_dyn_ave)
     891
     892     !Config  Key  = ok_dyn_xios
     893     !Config  Desc = sorties moyennes dans la dynamique
     894     !Config  Def  = n
     895     !Config  Help =
     896     !Config         
     897     ok_dyn_xios = .FALSE.
     898     CALL getin('ok_dyn_xios',ok_dyn_xios)
    882899
    883900     !Config  Key  = use_filtre_fft
     
    9931010     write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins
    9941011     write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave
     1012     write(lunout,*)' ok_dyn_xios = ', ok_dyn_xios
    9951013     write(lunout,*)' use_filtre_fft = ', use_filtre_fft
    9961014     write(lunout,*)' use_mpi_alloc = ', use_mpi_alloc
  • LMDZ6/trunk/libf/dyn3dmem/gcm.F90

    • Property svn:keywords set to Id
    r4139 r4146  
    1 ! $Id: $
     1!
     2! $Id$
     3!
    24
    35PROGRAM gcm
     
    2628                       itau_dyn,itau_phy,day_ini,jD_ref,jH_ref,day_end, &
    2729                       dt,hour_ini,itaufin
     30#ifdef CPP_XIOS
     31  USE mod_xios_dyn3dmem, ONLY: xios_dyn3dmem_init
     32#endif
    2833
    2934  IMPLICIT NONE
     
    109114  INTEGER :: an, mois, jour
    110115  REAL :: heure
     116  ! needed for xios interface
     117  character (len=10) :: xios_cal_type
     118  INTEGER :: anref, moisref, jourref
     119  REAL :: heureref
     120 
    111121
    112122
     
    174184     call ioconf_calendar('360d')
    175185     write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an'
     186     xios_cal_type='d360'
    176187  else if (calend == 'earth_365d') then
    177188     call ioconf_calendar('noleap')
    178189     write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an'
     190     xios_cal_type='noleap'
    179191  else if (calend == 'gregorian') then
    180192     call ioconf_calendar('gregorian')
    181193     write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile'
     194     xios_cal_type='gregorian'
    182195  else
    183196     abort_message = 'Mauvais choix de calendrier'
     
    331344  write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref'
    332345  write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref
    333   call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure)
     346  call ju2ymds(jD_ref+jH_ref,anref, moisref, jourref, heureref)
    334347  write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure'
    335   write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure
     348  write(lunout,*)jD_ref+jH_ref,anref, moisref, jourref, heureref
    336349#else
    337350  ! Ehouarn: we still need to define JD_ref and JH_ref
     
    421434  ecripar = .TRUE.
    422435
     436#define CPP_IOIPSL
    423437#ifdef CPP_IOIPSL
    424438  time_step = zdtvr
     
    440454  dtav = iperiod*dtvr/daysec
    441455#endif
     456#undef CPP_IOIPSL
     457
     458! setting up DYN3D/XIOS inerface
     459#ifdef CPP_XIOS
     460   if (ok_dyn_xios) then
     461     CALL xios_dyn3dmem_init(xios_cal_type, anref, moisref, jourref,heureref, an,   &
     462          mois, jour, heure, zdtvr)
     463  endif
     464#endif
     465
    442466  ! #endif of #ifdef CPP_IOIPSL
    443467  !
  • LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F

    • Property svn:keywords set to Id
    r4143 r4146  
    4242       USE temps_mod, ONLY: itaufin,jD_ref,jH_ref,day_ini,
    4343     &                        day_ref,start_time,dt
     44       USE xios, ONLY: xios_update_calendar
    4445       
    4546      IMPLICIT NONE
     
    16181619              ENDIF
    16191620#endif
     1621
     1622
    16201623            ENDIF
    16211624
     
    16421645             endif
    16431646#endif
    1644             endif ! of if (leapf.or.(.not.leapf.and.(.not.forward)))
     1647             
     1648#ifdef CPP_XIOS
     1649              IF (ok_dyn_xios) THEN
     1650c$OMP MASTER
     1651                 CALL xios_update_calendar(itau)
     1652c$OMP END MASTER
     1653c$OMP BARRIER
     1654                 CALL writedyn_xios(vcov,
     1655     &                 ucov,teta,pk,phi,q,masse,ps,phis)
     1656              ENDIF
     1657#endif
     1658             
     1659          endif                 ! of if (leapf.or.(.not.leapf.and.(.not.forward)))
     1660
     1661
    16451662           ENDIF ! of IF(MOD(itau,iecri).EQ.0)
    16461663
     
    17731790               ENDIF
    17741791#endif
     1792               
     1793
    17751794              ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin)
    17761795
     
    17911810              endif ! of if (ok_dyn_ins)
    17921811#endif
    1793               ENDIF ! of IF(MOD(itau,iecri).EQ.0)
     1812
     1813#ifdef CPP_XIOS
     1814              IF (ok_dyn_xios) THEN
     1815c$OMP MASTER
     1816                 CALL xios_update_calendar(itau)
     1817c$OMP END MASTER
     1818c$OMP BARRIER
     1819                 CALL writedyn_xios(vcov,
     1820     &                 ucov,teta,pk,phi,q,masse,ps,phis)
     1821              ENDIF
     1822#endif
     1823             
     1824           ENDIF                ! of IF(MOD(itau,iecri).EQ.0)
    17941825             
    17951826
  • LMDZ6/trunk/libf/dyn3dmem/mod_const_mpi.F90

    r2055 r4146  
    8888!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    8989#ifdef CPP_XIOS
     90      WRITE(*,*)'IN Init_mpi call wxios_init'
    9091      CALL wxios_init("LMDZ", outcom=COMM_LMDZ)
    9192#endif
  • LMDZ6/trunk/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90

    r2604 r4146  
    2020
    2121  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
    22   USE control_mod, ONLY: planet_type
     22  USE control_mod, ONLY: planet_type, ok_dyn_xios
    2323  USE physiq_mod, ONLY: physiq
     24#ifdef CPP_XIOS
     25  USE mod_xios_dyn3dmem, ONLY : dyn3d_ctx_handle
     26  USE xios, ONLY : xios_set_current_context
     27#endif
    2428  IMPLICIT NONE
    2529
     
    9094              zdpsrf_omp)
    9195
     96! switching back to LMDZDYN context
     97#ifdef CPP_XIOS
     98!$OMP MASTER
     99  if (ok_dyn_xios) then
     100     CALL xios_set_current_context(dyn3d_ctx_handle)
     101  endif
     102!$OMP END MASTER
     103#endif 
     104
    92105
    93106END SUBROUTINE call_physiq
  • LMDZ6/trunk/libf/misc/wxios.F90

    r3465 r4146  
    140140!            CALL wxios_context_init()
    141141!        ENDIF
     142         WRITE(*,*)'END of WXIOS_INIT', g_comm , g_ctx_name
    142143
    143144    END SUBROUTINE wxios_init
Note: See TracChangeset for help on using the changeset viewer.