source: trunk/WRF.COMMON/INTERFACES/dynphy_wrf_generic_lmd/update_outputs_physiq_mod.F

Last change on this file was 2018, checked in by mlefevre, 6 years ago

Added outputs for the generic models

File size: 6.8 KB
Line 
1MODULE update_outputs_physiq_mod
2
3CONTAINS
4
5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7SUBROUTINE update_outputs_physiq_surf( &
8            ims,ime,jms,jme,&
9            ips,ipe,jps,jpe,&
10            MARS_MODE,&
11            M_TSURF,M_CO2ICE,&
12            M_H2OICE)
13
14   !use surfdat_h, only: tsurf, co2ice, qsurf
15   use phys_state_var_mod, only : tsurf,qsurf
16
17   INTEGER, INTENT(IN) :: ims,ime,jms,jme
18   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe
19   INTEGER, INTENT(IN) :: MARS_MODE
20   INTEGER :: i,j,subs
21   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT)  :: &
22     M_TSURF,M_CO2ICE,M_H2OICE
23
24   DO j = jps,jpe
25   DO i = ips,ipe
26
27     !-----------------------------------!
28     ! 1D subscript for physics "cursor" !
29     !-----------------------------------!
30     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
31
32     !-------------------------------------------------------!
33     ! Save key variables for restart and output and nesting ! 
34     !-------------------------------------------------------!
35     M_TSURF(i,j) = tsurf(subs)
36
37   ENDDO
38   ENDDO
39
40END SUBROUTINE update_outputs_physiq_surf
41
42!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
43!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
44SUBROUTINE update_outputs_physiq_soil( &
45            ims,ime,jms,jme,&
46            ips,ipe,jps,jpe,&
47            nsoil,&
48            M_TSOIL)
49
50   !use comsoil_h, only: tsoil
51    use phys_state_var_mod, only : tsoil
52
53   INTEGER, INTENT(IN) :: ims,ime,jms,jme
54   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,nsoil
55   INTEGER :: i,j,subs
56   REAL, DIMENSION( ims:ime, nsoil, jms:jme ), INTENT(INOUT)  :: &
57     M_TSOIL
58
59   DO j = jps,jpe
60   DO i = ips,ipe
61
62     !-----------------------------------!
63     ! 1D subscript for physics "cursor" !
64     !-----------------------------------!
65     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
66
67     !-------------------------------------------------------!
68     ! Save key variables for restart and output and nesting ! 
69     !-------------------------------------------------------!
70     M_TSOIL(i,:,j) = tsoil(subs,:)
71
72   ENDDO
73   ENDDO
74
75END SUBROUTINE update_outputs_physiq_soil
76
77!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
78!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
79SUBROUTINE update_outputs_physiq_rad( &
80            ims,ime,jms,jme,&
81            ips,ipe,jps,jpe,&
82            M_FLUXRAD)
83
84   !use dimradmars_mod, only: fluxrad
85   use phys_state_var_mod, only : fluxrad
86
87   INTEGER, INTENT(IN) :: ims,ime,jms,jme
88   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe
89   INTEGER :: i,j,subs
90   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT)  :: M_FLUXRAD
91
92   DO j = jps,jpe
93   DO i = ips,ipe
94
95     !-----------------------------------!
96     ! 1D subscript for physics "cursor" !
97     !-----------------------------------!
98     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
99
100     !-------------------------------------------------------!
101     ! Save key variables for restart and output and nesting ! 
102     !-------------------------------------------------------!
103     M_FLUXRAD(i,j) = fluxrad(subs)
104
105   ENDDO
106   ENDDO
107
108END SUBROUTINE update_outputs_physiq_rad
109
110!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
111!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
112SUBROUTINE update_outputs_physiq_turb( &
113            ims,ime,jms,jme,kms,kme,&
114            ips,ipe,jps,jpe,kps,kpe,&
115            M_Q2,M_WSTAR,&
116            HFMAX,ZMAX,USTM,HFX)
117
118   use turb_mod, only: q2,wstar,ustar,sensibFlux!,&
119                        !hfmax_th,zmax_th
120   !use phys_state_var_mod, only : q2,sensibFlux
121
122   INTEGER, INTENT(IN) :: ims,ime,jms,jme,kms,kme
123   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe
124   INTEGER :: i,j,subs   
125   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT)  :: &
126     M_WSTAR,HFMAX,ZMAX,USTM,HFX
127   REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT) :: M_Q2
128 
129   DO j = jps,jpe
130   DO i = ips,ipe
131
132     !-----------------------------------!
133     ! 1D subscript for physics "cursor" !
134     !-----------------------------------!
135     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
136
137     !-------------------------------------------------------!
138     ! Save key variables for restart and output and nesting ! 
139     !-------------------------------------------------------!
140     M_Q2(i,kps:kpe+1,j) = q2(subs,:)
141     M_WSTAR(i,j) = wstar(subs)
142     !! output only (arrays already in phys modules)
143     !HFMAX(i,j) = HFMAX_TH(subs)
144     !ZMAX(i,j) = ZMAX_TH(subs)
145     USTM(i,j) = ustar(subs)
146     HFX(i,j) = sensibFlux(subs) ! *-1 ?????
147
148   ENDDO
149   ENDDO
150
151END SUBROUTINE update_outputs_physiq_turb
152
153!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
154!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
155SUBROUTINE update_outputs_physiq_diag( &
156            ims,ime,jms,jme,kms,kme,&
157            ips,ipe,jps,jpe,kps,kpe,&
158            SWDOWNZ,TAU_DUST,QSURFDUST,&
159            MTOT,ICETOT,TAU_ICE,&
160            HR_SW,HR_LW,HR_DYN,DT,DTRAD,&
161            RDUST,VMR_ICE,RICE,&
162            CLOUDFRAC,TOTCLOUDFRAC,&
163            RAIN,SNOW,REEVAP,SURFRAIN,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
164            FLUXSURF_LW,FLXGRD,LSCEZ,H2OICE_REFF,LATENT_HF)
165
166   USE comm_wrf !! to get fields to be written from physiq
167
168   INTEGER, INTENT(IN) :: ims,ime,jms,jme,kms,kme
169   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,kps,kpe
170   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: &
171     SWDOWNZ,TAU_DUST,QSURFDUST,&
172     MTOT,ICETOT,TAU_ICE,&
173     TOTCLOUDFRAC,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
174     FLUXSURF_LW,FLXGRD,LATENT_HF,REEVAP,SURFRAIN
175   REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: &
176     HR_SW,HR_LW,RDUST,VMR_ICE,RICE,CLOUDFRAC,HR_DYN,DT,DTRAD,RAIN,SNOW,&
177     LSCEZ,H2OICE_REFF
178   INTEGER :: i,j,subs
179
180   DO j = jps,jpe
181   DO i = ips,ipe
182
183     !-----------------------------------!
184     ! 1D subscript for physics "cursor" !
185     !-----------------------------------!
186     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
187
188     !! get diagnostics from physics
189     HR_SW(i,kps:kpe,j) = comm_HR_SW(subs,kps:kpe)
190     HR_LW(i,kps:kpe,j) = comm_HR_LW(subs,kps:kpe)
191     CLOUDFRAC(i,kps:kpe,j)= comm_CLOUDFRAC(subs,kps:kpe)
192     TOTCLOUDFRAC(i,j)= comm_TOTCLOUDFRAC(subs)
193     RAIN(i,kps:kpe,j) = comm_RAIN(subs,kps:kpe)
194     SNOW(i,kps:kpe,j) = comm_SNOW(subs,kps:kpe)
195     ALBEQ(i,j)=comm_ALBEQ(subs)
196     FLUXTOP_DN(i,j)=comm_FLUXTOP_DN(subs)
197     FLUXABS_SW(i,j)=comm_FLUXABS_SW(subs)
198     FLUXTOP_LW(i,j)=comm_FLUXTOP_LW(subs)
199     FLUXSURF_SW(i,j)=comm_FLUXSURF_SW(subs)
200     FLUXSURF_LW(i,j)=comm_FLUXSURF_LW(subs)
201     FLXGRD(i,j)=comm_FLXGRD(subs)
202     LSCEZ(i,kps:kpe,j)=comm_LSCEZ(subs,kps:kpe)
203     H2OICE_REFF(i,kps:kpe,j)=comm_H2OICE_REFF(subs,kps:kpe)
204     LATENT_HF(i,j)=comm_LATENT_HF(subs)
205     REEVAP(i,j)=comm_REEVAP(subs)
206     SURFRAIN(i,j)=comm_SURFRAIN(subs)
207
208   ENDDO
209   ENDDO
210
211   CALL deallocate_comm_wrf
212
213END SUBROUTINE update_outputs_physiq_diag
214
215END MODULE update_outputs_physiq_mod
216
217
218
Note: See TracBrowser for help on using the repository browser.