1 | SUBROUTINE surfini(ngrid,nq,qsurf,psolaralb) |
---|
2 | |
---|
3 | USE surfdat_h, only: albedodat, albedice |
---|
4 | USE tracer_h, only: igcm_co2_ice |
---|
5 | use comgeomfi_h, only: lati |
---|
6 | use planetwide_mod, only: planetwide_maxval, planetwide_minval |
---|
7 | use mod_phys_lmdz_para, only : is_master |
---|
8 | |
---|
9 | IMPLICIT NONE |
---|
10 | c======================================================================= |
---|
11 | c |
---|
12 | c creation des calottes pour l'etat initial |
---|
13 | c |
---|
14 | c======================================================================= |
---|
15 | c----------------------------------------------------------------------- |
---|
16 | c Declarations: |
---|
17 | c ------------- |
---|
18 | !#include "dimensions.h" |
---|
19 | !#include "dimphys.h" |
---|
20 | #include "callkeys.h" |
---|
21 | c |
---|
22 | INTEGER,INTENT(IN) :: ngrid |
---|
23 | INTEGER,INTENT(IN) :: nq |
---|
24 | REAL,INTENT(OUT) :: psolaralb(ngrid) |
---|
25 | REAL,INTENT(IN) :: qsurf(ngrid,nq) !tracer on surface (kg/m2) |
---|
26 | |
---|
27 | INTEGER :: ig,icap |
---|
28 | REAL :: min_albedo,max_albedo |
---|
29 | c |
---|
30 | c======================================================================= |
---|
31 | |
---|
32 | |
---|
33 | DO ig=1,ngrid |
---|
34 | psolaralb(ig)=albedodat(ig) |
---|
35 | ENDDO |
---|
36 | |
---|
37 | call planetwide_minval(albedodat,min_albedo) |
---|
38 | call planetwide_maxval(albedodat,max_albedo) |
---|
39 | if (is_master) then |
---|
40 | write(*,*) 'surfini: minimum corrected albedo',min_albedo |
---|
41 | write(*,*) 'surfini: maximum corrected albedo',max_albedo |
---|
42 | end if |
---|
43 | |
---|
44 | if (igcm_co2_ice.ne.0) then |
---|
45 | ! Change Albedo if there is CO2 ice on the surface |
---|
46 | DO ig=1,ngrid |
---|
47 | IF (qsurf(ig,igcm_co2_ice) .GT. 0.) THEN |
---|
48 | IF(lati(ig).LT.0.) THEN |
---|
49 | icap=2 ! Southern hemisphere |
---|
50 | ELSE |
---|
51 | icap=1 ! Northern hemisphere |
---|
52 | ENDIF |
---|
53 | psolaralb(ig) = albedice(icap) |
---|
54 | END IF |
---|
55 | ENDDO ! of DO ig=1,ngrid |
---|
56 | else |
---|
57 | if (is_master) then |
---|
58 | write(*,*) "surfini: No CO2 ice tracer on surface ..." |
---|
59 | write(*,*) " and therefore no albedo change." |
---|
60 | end if |
---|
61 | endif |
---|
62 | |
---|
63 | call planetwide_minval(psolaralb,min_albedo) |
---|
64 | call planetwide_maxval(psolaralb,max_albedo) |
---|
65 | if (is_master) then |
---|
66 | write(*,*) 'surfini: minimum corrected albedo',min_albedo |
---|
67 | write(*,*) 'surfini: maximum corrected albedo',max_albedo |
---|
68 | end if |
---|
69 | |
---|
70 | END |
---|