Changeset 593


Ignore:
Timestamp:
10/18/17 00:42:50 (7 years ago)
Author:
dubos
Message:

devel : fields for energy fluxes (diagflux)

Location:
codes/icosagcm/devel/src
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/src/diagnostics/diagflux.F90

    r592 r593  
    55   
    66  TYPE(t_field),POINTER :: & 
    7        f_masst(:), f_qmasst(:), & ! time-integrated mass, tracer mass,  
    8        f_massfluxt(:), f_qfluxt(:), & ! mass flux and tracer flux 
    9        f_qfluxt_lon(:), f_qfluxt_lat(:) ! scalar flux reconstructed  cell centers 
     7       f_masst(:), f_qmasst(:), & ! time-averaged mass, tracer mass,  
     8       f_massfluxt(:), f_qfluxt(:), & ! time-integrated mass flux and tracer flux 
     9       f_qfluxt_lon(:), f_qfluxt_lat(:), & ! scalar flux reconstructed at cell centers 
     10       f_epot(:), f_ekin(:), f_enthalpy(:), & ! time-averaged potential E, kinetic E and enthalpy 
     11       f_epotfluxt(:), f_ekinfluxt(:), f_enthalpyfluxt(:) ! time averaged 'fluxes' of epot, ekin and enthalpy 
    1012  LOGICAL :: diagflux_on 
    1113  !$OMP THREADPRIVATE(diagflux_on) 
     
    1517  SUBROUTINE init_diagflux 
    1618    USE getin_mod 
     19    INTEGER :: ll 
    1720    diagflux_on = .FALSE. 
    1821    CALL getin("diagflux", diagflux_on) 
    19     IF(diagflux_on) THEN 
    20        CALL allocate_field(f_masst,  field_t,type_real,llm, name="masst") 
    21        CALL allocate_field(f_qmasst,  field_t,type_real,llm,nqtot, name="qmasst") 
    22        CALL allocate_field(f_massfluxt, field_u,type_real,llm, name="massfluxt") 
    23        CALL allocate_field(f_qfluxt,  field_u,type_real,llm,nqtot, name="qfluxt") 
    24        CALL allocate_field(f_qfluxt_lon,  field_t,type_real,llm,nqtot, name="qfluxt_lon") 
    25        CALL allocate_field(f_qfluxt_lat,  field_t,type_real,llm,nqtot, name="qfluxt_lat") 
    26        CALL zero_qfluxt 
    27     ELSE 
    28        CALL allocate_field(f_masst,  field_t,type_real,0, name="masst") 
    29        CALL allocate_field(f_qmasst,  field_t,type_real,llm,0, name="qmasst") 
    30        CALL allocate_field(f_massfluxt, field_u,type_real,0, name="massfluxt") 
    31        CALL allocate_field(f_qfluxt,  field_u,type_real,llm,0, name="qfluxt") 
    32        CALL allocate_field(f_qfluxt_lon,  field_t,type_real,llm,0, name="qfluxt_lon") 
    33        CALL allocate_field(f_qfluxt_lat,  field_t,type_real,llm,0, name="qfluxt_lat") 
    34     END IF 
     22    ll = MERGE(ll,0,diagflux_on) 
     23    CALL allocate_field(f_masst,         field_t,type_real,ll,       name="masst") 
     24    CALL allocate_field(f_epot,          field_t,type_real,ll,       name="epot") 
     25    CALL allocate_field(f_ekin,          field_t,type_real,ll,       name="ekin") 
     26    CALL allocate_field(f_enthalpy,      field_t,type_real,ll,       name="enthalpy") 
     27    CALL allocate_field(f_qmasst,        field_t,type_real,ll,nqtot, name="qmasst") 
     28    CALL allocate_field(f_massfluxt,     field_u,type_real,ll,       name="massfluxt") 
     29    CALL allocate_field(f_epotfluxt,     field_u,type_real,ll,       name="epotfluxt") 
     30    CALL allocate_field(f_ekinfluxt,     field_u,type_real,ll,       name="ekinfluxt") 
     31    CALL allocate_field(f_enthalpyfluxt, field_u,type_real,ll,       name="enthalpyfluxt") 
     32    CALL allocate_field(f_qfluxt,        field_u,type_real,ll,nqtot, name="qfluxt") 
     33    CALL allocate_field(f_qfluxt_lon,    field_t,type_real,ll,nqtot, name="qfluxt_lon") 
     34    CALL allocate_field(f_qfluxt_lat,    field_t,type_real,ll,nqtot, name="qfluxt_lat") 
     35    IF(diagflux_on) CALL zero_qfluxt 
    3536  END SUBROUTINE init_diagflux 
    3637 
    3738  SUBROUTINE zero_qfluxt 
    38     USE mpipara 
    3939    USE omp_para 
    4040    INTEGER :: ind 
Note: See TracChangeset for help on using the changeset viewer.