Changeset 4236


Ignore:
Timestamp:
Sep 7, 2022, 6:28:48 PM (20 months ago)
Author:
Laurent Fairhead
Message:

Need to switch to the LMDZ context each time the physics is called if xios output is activated in the dynamics (forgot to commit)
LF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/physiq_mod.F90

    r4232 r4236  
    7878    USE VERTICAL_LAYERS_MOD, ONLY: aps,bps, ap, bp
    7979    USE write_field_phy
     80#ifdef CPP_XIOS
     81    USE wxios, ONLY: g_ctx, wxios_set_context
     82#endif
    8083    USE lscp_mod, ONLY : lscp
    8184    USE wake_ini_mod, ONLY : wake_ini
     
    117120
    118121#ifdef CPP_XIOS
    119     USE xios, ONLY: xios_update_calendar, xios_context_finalize, &
    120             xios_get_field_attr, xios_field_is_active
     122    USE xios, ONLY: xios_update_calendar, xios_context_finalize
     123    USE xios, ONLY: xios_get_field_attr, xios_field_is_active, xios_context
     124    USE xios, ONLY: xios_set_current_context
    121125    USE wxios, ONLY: missing_val, missing_val_omp
    122126#endif
     
    301305       zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic
    302306       !
    303 
    304307
    305308    IMPLICIT NONE
     
    488491    REAL dtadd(klon,klev)
    489492
     493!#ifdef CPP_XIOS
     494!    TYPE(xios_context), SAVE :: g_ctx
     495!#endif
     496
    490497#ifndef CPP_XIOS
    491498    REAL, SAVE :: missing_val=nf90_fill_real
     
    12161223    phys_tstep=NINT(pdtphys)
    12171224#ifdef CPP_XIOS
    1218     IF (.NOT. debut .AND. is_omp_master) CALL xios_update_calendar(itap+1)
     1225! switch to XIOS LMDZ physics context
     1226!!!!$OMP MASTER
     1227!!!!    WRITE(*,*)'PHYSICS XIOS Context :', g_ctx
     1228!!!!    CALL wxios_set_context()
     1229!!!!$OMP END MASTER
     1230    IF (.NOT. debut .AND. is_omp_master) THEN
     1231       CALL wxios_set_context()
     1232       CALL xios_update_calendar(itap+1)
     1233    ENDIF
    12191234#endif
    12201235
     
    22052220      ENDIF
    22062221    ENDIF
     2222! switch to XIOS LMDZ physics context just in case
     2223!$OMP MASTER
     2224!!!!#ifdef CPP_XIOS
     2225!!!!    WRITE(*,*)'PHYSICS XIOS Context :', g_ctx
     2226!!!!    CALL xios_set_current_context(g_ctx)
     2227!!!!#endif
     2228!$OMP END MASTER
     2229
    22072230    !
    22082231    !
Note: See TracChangeset for help on using the changeset viewer.