Ignore:
Timestamp:
Apr 3, 2023, 6:17:05 PM (23 months ago)
Author:
romain.vande
Message:

Mars PCM:
Add a new routine to write output called write_output.
It needs to be imported (for example : use write_output_mod, only: write_output)
Then, it requires only 4 arguments : the name of the variable, its title, its units and the variable itself.
It detects the dimension of the variable and decide to output either in diagfi or diagsoil.
It is also compatible with XIOS (xml file needs to be adapted)
Writediagfi and writediagsoil routines are still available in case.
RV

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/nonoro_gwd_ran_mod.F90

    r2682 r2932  
    4747      use vertical_layers_mod, only : presnivs
    4848      use geometry_mod, only: cell_area
     49      use write_output_mod, only: write_output
    4950#ifdef CPP_XIOS
    5051     use xios_output_mod, only: send_xios_field
     
    222223    PH(:, 1) = 2. * PP(:, 1) - PH(:, 2)
    223224
    224     call writediagfi(ngrid,'nonoro_pp','nonoro_pp', 'm',3,PP(:,1:nlayer))
    225     call writediagfi(ngrid,'nonoro_ph','nonoro_ph', 'm',3,PH(:,1:nlayer))
     225    call write_output('nonoro_pp','nonoro_pp', 'm',PP(:,:))
     226    call write_output('nonoro_ph','nonoro_ph', 'm',PH(:,:))
    226227
    227228    ! Launching level for reproductible case
     
    250251        ZH(:, 1) = H0 * LOG(PR / (PH(:, 1) + PSEC))
    251252
    252     call writediagfi(ngrid,'nonoro_zh','nonoro_zh', 'm',3,ZH(:,2:nlayer+1))
     253    call write_output('nonoro_zh','nonoro_zh', 'm',ZH(:,2:nlayer+1))
    253254
    254255    ! Winds and Brunt Vaisala frequency
     
    275276       MAX_K(II)=MAX(kmin,kstar)
    276277    ENDDO
    277     call writediagfi(ngrid,'nonoro_bv','nonoro_bv', 'm',3,BV(:,2:nlayer+1))
     278    call write_output('nonoro_bv','nonoro_bv', 'm',BV(:,2:nlayer+1))
    278279
    279280!-----------------------------------------------------------------------------------------------------------------------
     
    444445    ! (upward) that should be compensated by circulation
    445446    ! and induce additional friction at the surface
    446     call writediagfi(ngrid,'nonoro_u_epflux_tot','nonoro_u_epflux_tot', '',3,u_epflux_tot(:,2:nlayer+1))
    447     call writediagfi(ngrid,'nonoro_v_epflux_tot','nonoro_v_epflux_tot', '',3,v_epflux_tot(:,2:nlayer+1))
     447    call write_output('nonoro_u_epflux_tot','nonoro_u_epflux_tot', '',u_epflux_tot(:,2:nlayer+1))
     448    call write_output('nonoro_v_epflux_tot','nonoro_v_epflux_tot', '',v_epflux_tot(:,2:nlayer+1))
    448449
    449450    ! 5.2 AR-1 RECURSIVE FORMULA (13) IN VERSION 4
     
    457458    ENDDO
    458459    d_t(:,:) = 0.
    459     call writediagfi(ngrid,'nonoro_d_u','nonoro_d_u', '',3,d_u)
    460     call writediagfi(ngrid,'nonoro_d_v','nonoro_d_v', '',3,d_v)
     460    call write_output('nonoro_d_u','nonoro_d_u', '',d_u(:,:))
     461    call write_output('nonoro_d_v','nonoro_d_v', '',d_v(:,:))
    461462
    462463    ! 5.3 Update tendency of wind with the previous (and saved) values
     
    469470    dv_nonoro_gwd(:,:) = d_v(:,:)
    470471
    471     call writediagfi(ngrid,'du_nonoro_gwd','du_nonoro_gwd', '',3,du_nonoro_gwd)
    472     call writediagfi(ngrid,'dv_nonoro_gwd','dv_nonoro_gwd', '',3,dv_nonoro_gwd)
     472    call write_output('du_nonoro_gwd','du_nonoro_gwd', '',du_nonoro_gwd(:,:))
     473    call write_output('dv_nonoro_gwd','dv_nonoro_gwd', '',dv_nonoro_gwd(:,:))
    473474   
    474475    ! Cosmetic: evaluation of the cumulated stress
Note: See TracChangeset for help on using the changeset viewer.