| 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 | |
|---|
| 31 | MODULE MOD_COSP_MISR_SIMULATOR |
|---|
| 32 | USE MOD_COSP_CONSTANTS |
|---|
| 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 |
|---|