Ignore:
Timestamp:
Dec 16, 2025, 4:39:24 PM (4 weeks ago)
Author:
jbclement
Message:

PEM:
Apply documentation template everywhere: standardized headers format with short description, separators between functions/subroutines, normalized code sections, aligned dependencies/arguments/variables declaration.
JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/grid_conversion.F90

    r3980 r3991  
    11MODULE grid_conversion
     2!-----------------------------------------------------------------------
     3! NAME
     4!     grid_conversion
     5!
     6! DESCRIPTION
     7!     Provides tools to convert data between lon x lat grid format
     8!     and vector format.
     9!
     10! AUTHORS & DATE
     11!     JB Clement, 12/2025
     12!
     13! NOTES
     14!     Handles pole duplication differences between the grid format
     15!     and vector format.
     16!-----------------------------------------------------------------------
    217
     18! DECLARATION
     19! -----------
    320implicit none
    421
    5 !=======================================================================
    622contains
     23!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     24
    725!=======================================================================
    826SUBROUTINE lonlat2vect(nlon,nlat,ngrid,v_ll,v_vect)
    9 ! To convert data from lon x lat grid (where values at the poles are duplicated) into a vector
    10 ! /!\ The longitudes -180 and +180 are not duplicated like in the PCM dynamics
     27!-----------------------------------------------------------------------
     28! NAME
     29!     lonlat2vect
     30!
     31! DESCRIPTION
     32!     Convert data from lon x lat grid (where values at the poles are
     33!     duplicated) into a vector.
     34!
     35! AUTHORS & DATE
     36!     JB Clement, 12/2025
     37!
     38! NOTES
     39!     The longitudes -180 and +180 are not duplicated like in the PCM
     40!     dynamics.
     41!
     42!-----------------------------------------------------------------------
    1143
     44! DECLARATION
     45! -----------
    1246implicit none
    1347
    1448! Arguments
    1549!----------
    16 integer,                    intent(in) :: nlon, nlat, ngrid
    17 real, dimension(nlon,nlat), intent(in) :: v_ll
    18 real, dimension(ngrid), intent(out) :: v_vect
     50integer,                    intent(in)  :: nlon, nlat, ngrid
     51real, dimension(nlon,nlat), intent(in)  :: v_ll
     52real, dimension(ngrid),     intent(out) :: v_vect
    1953
    2054! Local variables
     
    4882
    4983END SUBROUTINE lonlat2vect
     84!=======================================================================
    5085
    5186!=======================================================================
    5287SUBROUTINE vect2lonlat(nlon,nlat,ngrid,v_vect,v_ll)
    53 ! To convert data from a vector into lon x lat grid (where values at the poles are duplicated)
    54 ! /!\ The longitudes -180 and +180 are not duplicated like in the PCM dynamics
     88!-----------------------------------------------------------------------
     89! NAME
     90!     vect2lonlat
     91!
     92! DESCRIPTION
     93!     Convert data from a vector into lon x lat grid (where values
     94!     at the poles are duplicated).
     95!
     96! AUTHORS & DATE
     97!     JB Clement, 12/2025
     98!
     99! NOTES
     100!     The longitudes -180 and +180 are not duplicated like in the PCM
     101!     dynamics.
     102!-----------------------------------------------------------------------
    55103
     104! DECLARATION
     105! -----------
    56106implicit none
    57107
    58108! Arguments
    59109!----------
    60 integer,                intent(in) :: nlon, nlat, ngrid
    61 real, dimension(ngrid), intent(in) :: v_vect
     110integer,                    intent(in) :: nlon, nlat, ngrid
     111real, dimension(ngrid),     intent(in) :: v_vect
    62112real, dimension(nlon,nlat), intent(out) :: v_ll
    63113
     
    92142
    93143END SUBROUTINE vect2lonlat
     144!=======================================================================
    94145
    95146END MODULE grid_conversion
Note: See TracChangeset for help on using the changeset viewer.