Ignore:
Timestamp:
Jan 23, 2020, 10:46:58 AM (5 years ago)
Author:
emillour
Message:

Mars GCM:
First implementation of XIOS in the physics
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r2220 r2223  
    7171      use comm_wrf
    7272#else
    73       use planetwide_mod
     73      USE planetwide_mod, ONLY: planetwide_maxval, planetwide_minval,
     74     &                          planetwide_sumval
    7475      use phyredem, only: physdem0, physdem1
    7576      use phyetat0_mod, only: phyetat0
    7677      use eofdump_mod, only: eofdump
    77       USE vertical_layers_mod, ONLY: ap,bp,aps,bps
    78      
     78      USE vertical_layers_mod, ONLY: ap,bp,aps,bps,presnivs,pseudoalt
     79      USE mod_phys_lmdz_omp_data, ONLY: is_omp_master
    7980#endif
    8081
    81 
     82#ifdef CPP_XIOS     
     83      use xios_output_mod, only: initialize_xios_output,
     84     &                           update_xios_timestep,
     85     &                           send_xios_field
     86      use wxios, only: wxios_context_init, xios_context_finalize
     87#endif
    8288
    8389      IMPLICIT NONE
     
    491497#endif
    492498
     499#ifdef CPP_XIOS
     500         ! Initialize XIOS context
     501         write(*,*) "physiq: call wxios_context_init"
     502         CALL wxios_context_init
     503#endif
     504
    493505c        read startfi
    494506c        ~~~~~~~~~~~~
     
    630642#endif
    631643                 
     644#ifdef CPP_XIOS
     645        ! XIOS outputs
     646        write(*,*) "physiq firstcall: call initialize_xios_output"
     647        call initialize_xios_output(pday,ptime,ptimestep,daysec,
     648     &                              presnivs,pseudoalt)
     649#endif
    632650      ENDIF        !  (end of "if firstcall")
    633651
     
    637655c ---------------------------------------------------
    638656c
     657
     658#ifdef CPP_XIOS     
     659      ! update XIOS time/calendar
     660      call update_xios_timestep
     661#endif     
    639662
    640663c     Initialize various variables
     
    34443467      END IF       ! if(ngrid.ne.1)
    34453468
     3469! XIOS outputs
     3470#ifdef CPP_XIOS     
     3471      ! Send fields to XIOS: (NB these fields must also be defined as
     3472      ! <field id="..." /> in context_lmdz_physics.xml to be correctly used)
     3473      CALL send_xios_field("ls",zls*180./pi)
     3474     
     3475      CALL send_xios_field("ps",ps)
     3476      CALL send_xios_field("area",cell_area)
     3477     
     3478      CALL send_xios_field("temperature",zt)
     3479      CALL send_xios_field("u",zu)
     3480      CALL send_xios_field("v",zv)
     3481
     3482      if (lastcall.and.is_omp_master) then
     3483        write(*,*) "physiq lastcall: call xios_context_finalize"
     3484        call xios_context_finalize
     3485      endif
     3486#endif
     3487
     3488
    34463489      icount=icount+1
    34473490       
Note: See TracChangeset for help on using the changeset viewer.