LMDZ
cosp_misr_simulator.F90
Go to the documentation of this file.
1 ! (c) British Crown Copyright 2008, the Met Office.
2 ! All rights reserved.
3 !
4 ! Redistribution and use in source and binary forms, with or without modification, are permitted
5 ! provided that the following conditions are met:
6 !
7 ! * Redistributions of source code must retain the above copyright notice, this list
8 ! of conditions and the following disclaimer.
9 ! * Redistributions in binary form must reproduce the above copyright notice, this list
10 ! of conditions and the following disclaimer in the documentation and/or other materials
11 ! provided with the distribution.
12 ! * Neither the name of the Met Office nor the names of its contributors may be used
13 ! to endorse or promote products derived from this software without specific prior written
14 ! permission.
15 !
16 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
17 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 ! FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19 ! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 ! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 ! DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22 ! IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
23 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 !
26 ! History:
27 ! Nov 2008 - A. Bodas-Salcedo - Initial version
28 !
29 !
30 
33  USE mod_cosp_types
34  IMPLICIT NONE
35 
36 CONTAINS
37 
38 
39 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40 !-------------- SUBROUTINE COSP_MISR_SIMULATOR -----------------
41 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42 SUBROUTINE cosp_misr_simulator(gbx,sgx,y)
43 
44  ! Arguments
45  type(cosp_gridbox),intent(in) :: gbx ! Gridbox info
46  type(cosp_subgrid),intent(in) :: sgx ! Subgridbox info
47  type(cosp_misr),intent(inout) :: y ! MISR simulator output
48 
49  ! Local variables
50  integer :: i,Nlevels,Npoints
51  real :: dtau_s(gbx%npoints, gbx%nlevels)
52  real :: dtau_c(gbx%npoints, gbx%nlevels)
53  real :: at(gbx%npoints, gbx%nlevels)
54  real :: frac_out(gbx%npoints, gbx%ncolumns, gbx%nlevels)
55  integer :: sunlit(gbx%npoints)
56 
57  real :: zfull(gbx%npoints, gbx%nlevels) ! height (in meters) of full model levels (i.e. midpoints)
58  ! zfull(npoints,1) is top level of model
59  ! zfull(npoints,nlev) is bottom level of model
60  real :: phy_t0p1_mean_ztop ! mean cloud top height(m) of 0.1 tau treshold
61  real :: fq_phy_t0p1_TAU_v_CTH(7,16)
62 
63 
64  nlevels = gbx%Nlevels
65  npoints = gbx%Npoints
66  ! Levels from TOA to surface
67  zfull = gbx%zlev(:,nlevels:1:-1)
68  at = gbx%T(:,nlevels:1:-1)
69  dtau_s = gbx%dtau_s(:,nlevels:1:-1)
70  dtau_c = gbx%dtau_c(:,nlevels:1:-1)
71  frac_out(1:npoints,:,1:nlevels) = sgx%frac_out(1:npoints,:,nlevels:1:-1)
72  sunlit = int(gbx%sunlit)
73 
74  call misr_simulator(gbx%npoints,gbx%nlevels,gbx%ncolumns,&
75  sunlit,zfull,at,dtau_s,dtau_c,frac_out, &
76  y%fq_MISR,y%MISR_dist_model_layertops,y%MISR_meanztop,y%MISR_cldarea)
77 
78 END SUBROUTINE cosp_misr_simulator
79 
80 END MODULE mod_cosp_misr_simulator
subroutine cosp_misr_simulator(gbx, sgx, y)
subroutine misr_simulator(npoints, nlev, ncol, sunlit, zfull, at, dtau_s, dtau_c, frac_out, fq_MISR_TAU_v_CTH, dist_model_layertops, MISR_mean_ztop, MISR_cldarea)