Ignore:
Timestamp:
Oct 18, 2023, 3:35:24 PM (12 months ago)
Author:
jbclement
Message:

Marc PCM:

  • Correction of a bug in "writediagfi.F": the case of using the 1D model with parallelization was not anticipated so that the "diagfi.nc" file was filled with NaNf?;
  • Addition of the file "start1D.txt" as an example in the directory deftank/;
  • Some "cosmetic" modifications in "improvedclouds_mod.F", "write_output_mod.F90" and "testphys1d.F90".

JBC

File:
1 edited

Legend:

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

    r3055 r3092  
    11MODULE write_output_mod
    2     IMPLICIT NONE
     2
     3IMPLICIT NONE
     4
    35PRIVATE
    4    
    5     INTERFACE write_output
    6       MODULE PROCEDURE write_output_d0,write_output_d1,write_output_d2, &
    7                        write_output_i0,write_output_i1,write_output_i2, &
    8                        write_output_l0,write_output_l1,write_output_l2
    9 
    10     END INTERFACE write_output
    11 
    12     PUBLIC write_output
    13    
     6
     7INTERFACE write_output
     8    MODULE PROCEDURE write_output_d0, write_output_d1, write_output_d2, &
     9                     write_output_i0, write_output_i1, write_output_i2, &
     10                     write_output_l0, write_output_l1, write_output_l2
     11END INTERFACE write_output
     12
     13PUBLIC write_output
     14
     15!----------------------------------------------------------------------
    1416CONTAINS
     17!----------------------------------------------------------------------
    1518
    1619  SUBROUTINE write_output_d0(field_name,title,units,field)
     
    2831  CHARACTER(LEN=*),INTENT(IN)    :: units
    2932  REAL,INTENT(IN)                :: field
    30  
     33
    3134  call writediagfi(ngrid,field_name,title,units,0,field)
    32 #ifdef CPP_XIOS 
     35#ifdef CPP_XIOS
    3336  if (xios_is_active_field(field_name)) then
    3437    ! only send the field to xios if the user asked for it
     
    3639  endif
    3740#endif
    38  
     41
    3942  END SUBROUTINE write_output_d0
    4043
     44!----------------------------------------------------------------------
     45
    4146  SUBROUTINE write_output_d1(field_name,title,units,field)
    4247  ! For a surface field
     
    5358  CHARACTER(LEN=*),INTENT(IN)    :: units
    5459  REAL,INTENT(IN)                :: field(:)
    55  
     60
    5661  call writediagfi(ngrid,field_name,title,units,2,field)
    57 #ifdef CPP_XIOS 
     62#ifdef CPP_XIOS
    5863  if (xios_is_active_field(field_name)) then
    5964    ! only send the field to xios if the user asked for it
     
    6166  endif
    6267#endif
    63  
     68
    6469  END SUBROUTINE write_output_d1
     70
     71!----------------------------------------------------------------------
    6572
    6673  SUBROUTINE write_output_d2(field_name,title,units,field)
     
    8390  if(size(field(:,:),2).eq.nsoilmx) then
    8491    call writediagsoil(ngrid,field_name,title,units,3,field)
    85   else 
     92  else
    8693    call writediagfi(ngrid,field_name,title,units,3,field(:,:))
    8794  endif
    88 #ifdef CPP_XIOS 
     95#ifdef CPP_XIOS
    8996  if (xios_is_active_field(field_name)) then
    9097    ! only send the field to xios if the user asked for it
     
    9299  endif
    93100#endif
    94  
     101
    95102  END SUBROUTINE write_output_d2
    96103
     104!----------------------------------------------------------------------
     105
    97106  SUBROUTINE write_output_i0(field_name,title,units,field)
    98107  ! For a surface field
     
    109118  CHARACTER(LEN=*),INTENT(IN)    :: units
    110119  INTEGER,INTENT(IN)             :: field
    111  
     120
    112121  call writediagfi(ngrid,field_name,title,units,0,real(field))
    113 #ifdef CPP_XIOS 
     122#ifdef CPP_XIOS
    114123  if (xios_is_active_field(field_name)) then
    115124    ! only send the field to xios if the user asked for it
     
    117126  endif
    118127#endif
    119  
     128
    120129  END SUBROUTINE write_output_i0
    121130
     131!----------------------------------------------------------------------
     132
    122133  SUBROUTINE write_output_i1(field_name,title,units,field)
    123134  ! For a surface field
     
    134145  CHARACTER(LEN=*),INTENT(IN)    :: units
    135146  INTEGER,INTENT(IN)             :: field(:)
    136  
     147
    137148  call writediagfi(ngrid,field_name,title,units,2,real(field))
    138 #ifdef CPP_XIOS 
     149#ifdef CPP_XIOS
    139150  if (xios_is_active_field(field_name)) then
    140151    ! only send the field to xios if the user asked for it
     
    142153  endif
    143154#endif
    144  
     155
    145156  END SUBROUTINE write_output_i1
     157
     158!----------------------------------------------------------------------
    146159
    147160  SUBROUTINE write_output_i2(field_name,title,units,field)
     
    164177  if(size(field(:,:),2).eq.nsoilmx) then
    165178    call writediagsoil(ngrid,field_name,title,units,3,real(field))
    166   else 
     179  else
    167180    call writediagfi(ngrid,field_name,title,units,3,real(field(:,:)))
    168181  endif
    169 #ifdef CPP_XIOS 
     182#ifdef CPP_XIOS
    170183  if (xios_is_active_field(field_name)) then
    171184    ! only send the field to xios if the user asked for it
     
    173186  endif
    174187#endif
    175  
     188
    176189  END SUBROUTINE write_output_i2
     190
     191!----------------------------------------------------------------------
    177192
    178193  SUBROUTINE write_output_l0(field_name,title,units,field)
     
    195210  field_real=0
    196211  if(field) field_real=1
    197  
     212
    198213  call writediagfi(ngrid,field_name,title,units,0,field_real)
    199 #ifdef CPP_XIOS 
     214#ifdef CPP_XIOS
    200215  if (xios_is_active_field(field_name)) then
    201216    ! only send the field to xios if the user asked for it
     
    203218  endif
    204219#endif
    205  
     220
    206221  END SUBROUTINE write_output_l0
     222
     223!----------------------------------------------------------------------
    207224
    208225  SUBROUTINE write_output_l1(field_name,title,units,field)
     
    228245    if(field(i)) field_real(i)=1.
    229246  ENDDO
    230  
     247
    231248  call writediagfi(ngrid,field_name,title,units,2,field_real(:))
    232 #ifdef CPP_XIOS 
     249#ifdef CPP_XIOS
    233250  if (xios_is_active_field(field_name)) then
    234251    ! only send the field to xios if the user asked for it
     
    236253  endif
    237254#endif
    238  
     255
    239256  END SUBROUTINE write_output_l1
     257
     258!----------------------------------------------------------------------
    240259
    241260  SUBROUTINE write_output_l2(field_name,title,units,field)
     
    270289  if(size(field(:,:),2).eq.nsoilmx) then
    271290    call writediagsoil(ngrid,field_name,title,units,3,field_real)
    272   else 
     291  else
    273292    call writediagfi(ngrid,field_name,title,units,3,field_real(:,:))
    274293  endif
    275294
    276 #ifdef CPP_XIOS 
     295#ifdef CPP_XIOS
    277296  if (xios_is_active_field(field_name)) then
    278297    ! only send the field to xios if the user asked for it
     
    280299  endif
    281300#endif
    282  
     301
    283302  deallocate(field_real)
    284303
Note: See TracChangeset for help on using the changeset viewer.