source: trunk/LMDZ.GENERIC/libf/phystd/surfini.F @ 3523

Last change on this file since 3523 was 3335, checked in by emillour, 6 months ago

Generic PCM:
Add reading/writing of surface albedo in (re)startfi.nc to
improve model restartability. For now only the simpler case
of non-spectral dependent surface albedo is handled.
Turned "surfini" in a module in the process.
Unrelated: added missing delarations in kcm1d so it compiles one again.
EM

File size: 2.5 KB
RevLine 
[3335]1      MODULE surfini_mod
2     
3      IMPLICIT NONE
4     
5      CONTAINS
6
[1482]7      SUBROUTINE surfini(ngrid,nq,qsurf,albedo,albedo_bareground,
8     &                   albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
[787]9
[3335]10      USE surfdat_h, only: albedodat ! bare ground albedo
[1216]11      use planetwide_mod, only: planetwide_maxval, planetwide_minval
[3335]12      use radinc_h, only : L_NSPECTV ! number of spectral bands in the visible
[1482]13      use callkeys_mod, only : albedosnow, albedoco2ice
[787]14
[135]15      IMPLICIT NONE
[1482]16     
17     
18ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
19cccccccccccccc                                                                 cccccccccccccc
20cccccccccccccc   Spectral Albedo Initialisation - Routine modified by MT2015.  cccccccccccccc
21cccccccccccccc                                                                 cccccccccccccc
22ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
23
24
25c--------------------
[135]26c   Declarations:
[1482]27c--------------------
28
[1216]29      INTEGER,INTENT(IN) :: ngrid
30      INTEGER,INTENT(IN) :: nq
[3335]31      REAL,INTENT(IN) :: albedo(ngrid,L_NSPECTV)
[1482]32      REAL,INTENT(OUT) :: albedo_bareground(ngrid)
33      REAL,INTENT(OUT) :: albedo_snow_SPECTV(L_NSPECTV)
34      REAL,INTENT(OUT) :: albedo_co2_ice_SPECTV(L_NSPECTV)
35      REAL,INTENT(IN) :: qsurf(ngrid,nq) ! tracer on surface (kg/m2)
[135]36
[1482]37      INTEGER :: ig,nw
[1216]38      REAL :: min_albedo,max_albedo
[1482]39
[135]40c=======================================================================
41
[1482]42      ! Step 1 : Initialisation of the Spectral Albedos.
43      DO nw=1,L_NSPECTV
44         albedo_snow_SPECTV(nw)=albedosnow
45         albedo_co2_ice_SPECTV(nw)=albedoco2ice
46      ENDDO
[135]47
[1482]48
49      ! Step 2 : We get the bare ground albedo from the start files.
[135]50      DO ig=1,ngrid
[1482]51         albedo_bareground(ig)=albedodat(ig)
[135]52      ENDDO
[1482]53      call planetwide_minval(albedo_bareground,min_albedo)
54      call planetwide_maxval(albedo_bareground,max_albedo)
55      write(*,*) 'surfini: minimum bare ground albedo',min_albedo
56      write(*,*) 'surfini: maximum bare ground albedo',max_albedo
[135]57
58
[3335]59      ! Step 3 : Surface albedo already loaded from startfi.nc
60      ! merely report vmin/max values here
61
[1482]62      call planetwide_minval(albedo,min_albedo)
63      call planetwide_maxval(albedo,max_albedo)
64      write(*,*) 'surfini: minimum corrected initial albedo',min_albedo
65      write(*,*) 'surfini: maximum corrected initial albedo',max_albedo
[135]66
67
[3335]68      END SUBROUTINE surfini
69     
70      END MODULE surfini_mod
Note: See TracBrowser for help on using the repository browser.