source: trunk/LMDZ.COMMON/libf/evolution/frost.F90 @ 4177

Last change on this file since 4177 was 4147, checked in by jbclement, 4 weeks ago

PEM:

  • Simplification of subroutines to convert data between the physical and the dynamical/lon-lat grids + making them more robust.
  • Correction for air mass to give back to the PCM. The variable is extensive so poles must be treated specifically.
  • Making the PEM able to do 0 year.
  • Explicit information about the frost values computed by the PEM + enforcing positivity of yearly minima.

JBC

File size: 5.9 KB
RevLine 
[4065]1MODULE frost
[3991]2!-----------------------------------------------------------------------
3! NAME
[4065]4!     frost
[3991]5!
6! DESCRIPTION
7!     Module for managing frost variables.
8!
9! AUTHORS & DATE
10!     JB Clement, 12/2025
11!
12! NOTES
13!
14!-----------------------------------------------------------------------
[3984]15
[4065]16! DEPENDENCIES
17! ------------
18use numerics, only: dp, di
19
[3991]20! DECLARATION
21! -----------
[3984]22implicit none
23
[4065]24! VARIABLES
25! ---------
[3989]26! Different types of frost retained by the PEM to give back to the PCM at the end
[4065]27real(dp), dimension(:,:), allocatable :: h2o_frost4PCM
28real(dp), dimension(:,:), allocatable :: co2_frost4PCM
[3984]29
[4065]30! PARAMETERS
31! ----------
32! Different types of frost in the PCM at the beginning [Pa]
33real(dp), dimension(:,:), allocatable, protected :: h2ofrost_PCM
34real(dp), dimension(:,:), allocatable, protected :: co2frost_PCM
[3984]35
36contains
[3991]37!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
38
[3984]39!=======================================================================
[4065]40SUBROUTINE ini_frost()
[3991]41!-----------------------------------------------------------------------
42! NAME
[4065]43!     ini_frost
[3991]44!
45! DESCRIPTION
[4065]46!     Initialize the parameters of module 'frost'.
[3991]47!
48! AUTHORS & DATE
49!     JB Clement, 12/2025
50!
51! NOTES
52!
53!-----------------------------------------------------------------------
[3984]54
[4065]55! DEPENDENCIES
56! ------------
57use geometry, only: ngrid, nslope
58
[3991]59! DECLARATION
60! -----------
[3984]61implicit none
62
[3991]63! CODE
64! ----
[4134]65allocate(h2ofrost_PCM(ngrid,nslope))
66allocate(co2frost_PCM(ngrid,nslope))
67allocate(h2o_frost4PCM(ngrid,nslope))
68allocate(co2_frost4PCM(ngrid,nslope))
[4074]69h2ofrost_PCM(:,:) = 0._dp
70co2frost_PCM(:,:) = 0._dp
71h2o_frost4PCM(:,:) = 0._dp
72co2_frost4PCM(:,:) = 0._dp
[3984]73
[4065]74END SUBROUTINE ini_frost
[3984]75!=======================================================================
76
[3991]77!=======================================================================
[4065]78SUBROUTINE end_frost()
[3991]79!-----------------------------------------------------------------------
80! NAME
[4065]81!     end_frost
[3991]82!
83! DESCRIPTION
[4065]84!     Deallocate frost arrays.
[3991]85!
86! AUTHORS & DATE
87!     JB Clement, 12/2025
88!
89! NOTES
[4065]90!
[3991]91!-----------------------------------------------------------------------
[3984]92
[3991]93! DECLARATION
94! -----------
[3984]95implicit none
96
[3991]97! CODE
98! ----
[4065]99if (allocated(h2ofrost_PCM)) deallocate(h2ofrost_PCM)
100if (allocated(co2frost_PCM)) deallocate(co2frost_PCM)
101if (allocated(h2o_frost4PCM)) deallocate(h2o_frost4PCM)
102if (allocated(co2_frost4PCM)) deallocate(co2_frost4PCM)
[3984]103
[4065]104END SUBROUTINE end_frost
[3984]105!=======================================================================
106
[3991]107!=======================================================================
[4065]108SUBROUTINE set_h2ofrost_PCM(h2ofrost_PCM_in)
[3991]109!-----------------------------------------------------------------------
110! NAME
[4065]111!     set_h2ofrost_PCM
[3991]112!
113! DESCRIPTION
[4065]114!     Setter for 'h2ofrost_PCM'.
[3991]115!
116! AUTHORS & DATE
117!     JB Clement, 12/2025
118!
119! NOTES
120!
121!-----------------------------------------------------------------------
[3984]122
[3991]123! DECLARATION
124! -----------
[3984]125implicit none
126
[3991]127! ARGUMENTS
128! ---------
[4065]129real(dp), dimension(:,:), intent(in) :: h2ofrost_PCM_in
[3984]130
[3991]131! CODE
132! ----
[4065]133h2ofrost_PCM(:,:) = h2ofrost_PCM_in(:,:)
[3984]134
[4065]135END SUBROUTINE set_h2ofrost_PCM
[3984]136!=======================================================================
137
[3991]138!=======================================================================
[4065]139SUBROUTINE set_co2frost_PCM(co2frost_PCM_in)
[3991]140!-----------------------------------------------------------------------
141! NAME
[4065]142!     set_co2frost_PCM
[3991]143!
144! DESCRIPTION
[4065]145!     Setter for 'co2frost_PCM'.
[3991]146!
147! AUTHORS & DATE
148!     JB Clement, 12/2025
149!
150! NOTES
151!
152!-----------------------------------------------------------------------
[3984]153
[3991]154! DECLARATION
155! -----------
[3984]156implicit none
157
[3991]158! ARGUMENTS
159! ---------
[4065]160real(dp), dimension(:,:), intent(in) :: co2frost_PCM_in
[3984]161
[3991]162! CODE
163! ----
[4065]164co2frost_PCM(:,:) = co2frost_PCM_in(:,:)
[3984]165
[4065]166END SUBROUTINE set_co2frost_PCM
[3984]167!=======================================================================
168
[3991]169!=======================================================================
[4071]170SUBROUTINE compute_frost4PCM(minPCM_h2ofrost,minPCM_co2frost)
[3991]171!-----------------------------------------------------------------------
172! NAME
[4065]173!     compute_frost4PCM
[3991]174!
175! DESCRIPTION
[4065]176!     Compute the frost to give back to the PCM (metamorphism).
[3991]177!
178! AUTHORS & DATE
179!     JB Clement, 12/2025
180!
181! NOTES
[4147]182!     For the PEM, frost is the extra part of the PCM frost above the
[4065]183!     yearly minimum.
[3991]184!-----------------------------------------------------------------------
[3984]185
[4065]186! DEPENDENCIES
187! ------------
[4110]188use display, only: print_msg, LVL_NFO
[4147]189use utility, only: real2str
[4065]190
[3991]191! DECLARATION
192! -----------
[3984]193implicit none
194
[4065]195! ARGUMENTS
196! ---------
[4071]197real(dp), dimension(:,:), intent(in) :: minPCM_h2ofrost, minPCM_co2frost
[4065]198
[3991]199! CODE
200! ----
[4110]201call print_msg('> Computing frost to give back to the PCM (metamorphism)',LVL_NFO)
[3984]202
[4065]203h2o_frost4PCM(:,:) = 0._dp
204co2_frost4PCM(:,:) = 0._dp
[4071]205where (h2ofrost_PCM(:,:) > 0._dp) h2o_frost4PCM(:,:) = h2ofrost_PCM(:,:) - minPCM_h2ofrost(:,:)
[4147]206call print_msg('Yearly minimum of H2O frost [kg/m2] (min|max): '//real2str(minval(minPCM_h2ofrost))//' | '//real2str(maxval(minPCM_h2ofrost)),LVL_NFO)
207call print_msg('Raw input of H2O frost      [kg/m2] (min|max): '//real2str(minval(h2ofrost_PCM))//' | '//real2str(maxval(h2ofrost_PCM)),LVL_NFO)
208call print_msg('Residual H2O frost          [kg/m2] (min|max): '//real2str(minval(h2o_frost4PCM))//' | '//real2str(maxval(h2o_frost4PCM)),LVL_NFO)
[4071]209where (co2frost_PCM(:,:) > 0._dp) co2_frost4PCM(:,:) = co2frost_PCM(:,:) - minPCM_co2frost(:,:)
[4147]210call print_msg('Yearly minimum of CO2 frost [kg/m2] (min|max): '//real2str(minval(minPCM_co2frost))//' | '//real2str(maxval(minPCM_co2frost)),LVL_NFO)
211call print_msg('Raw input of CO2 frost      [kg/m2] (min|max): '//real2str(minval(co2frost_PCM))//' | '//real2str(maxval(co2frost_PCM)),LVL_NFO)
212call print_msg('Residual CO2 frost          [kg/m2] (min|max): '//real2str(minval(co2_frost4PCM))//' | '//real2str(maxval(co2_frost4PCM)),LVL_NFO)
[4065]213
214END SUBROUTINE compute_frost4PCM
[3991]215!=======================================================================
[3984]216
[4065]217END MODULE frost
Note: See TracBrowser for help on using the repository browser.