SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
ini_ssowork.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 ! #########
6  SUBROUTINE ini_ssowork(PMESHLENGTH,PDLAT,PDLON)
7 ! ###############################################
8 !
9 !!**** *INI_SSOWORK* initializes and allocate work arrays for SSO reading
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !! METHOD
15 !! ------
16 !!
17 !
18 !! EXTERNAL
19 !! --------
20 !!
21 !! IMPLICIT ARGUMENTS
22 !! ------------------
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !! AUTHOR
28 !! ------
29 !!
30 !! V. Masson Meteo-France
31 !!
32 !! MODIFICATION
33 !! ------------
34 !!
35 !! Original 10/12/97
36 !!
37 !
38 USE modd_pgdwork, ONLY : xssqo, lssqo, nsso
39 USE modd_surf_par, ONLY : nundef, xundef
40 USE modd_pgd_grid, ONLY : nl
41 !
42 !
43 USE yomhook ,ONLY : lhook, dr_hook
44 USE parkind1 ,ONLY : jprb
45 !
46 IMPLICIT NONE
47 !
48 !----------------------------------------------------------------------------
49 !
50 !* 0.1 Declaration of arguments
51 ! ------------------------
52 !
53 REAL, OPTIONAL, INTENT(IN) :: pmeshlength ! average mesh length in degrees
54 REAL, OPTIONAL, INTENT(IN) :: pdlat ! input file mesh size (in latitude, degrees)
55 REAL, OPTIONAL, INTENT(IN) :: pdlon ! input file mesh size (in longitude, degrees)
56 REAL(KIND=JPRB) :: zhook_handle
57 !
58 !----------------------------------------------------------------------------
59 !
60 !
61 !* 1. Adapt subgrid mesh to input file resolution
62 ! -------------------------------------------
63 !
64 IF (lhook) CALL dr_hook('INI_SSOWORK',0,zhook_handle)
65 IF (present(pmeshlength) .AND. present(pdlat) .AND. present(pdlon)) THEN
66  IF (pdlat/= xundef .AND. pdlon /= xundef) THEN
67  nsso = nint( 2. * pmeshlength / (pdlat + pdlon) )
68  nsso = max(nsso,3)
69  nsso = min(nsso,10)
70  ELSE
71  nsso = 10
72  END IF
73 ELSE
74  nsso = 10
75 END IF
76 !
77 !----------------------------------------------------------------------------
78 !
79 !* 2. Allocate subgrid arrays
80 ! -----------------------
81 !
82 IF (ALLOCATED(xssqo)) DEALLOCATE(xssqo)
83 IF (ALLOCATED(lssqo)) DEALLOCATE(lssqo)
84 !
85 ALLOCATE(xssqo(nsso,nsso,nl))
86 ALLOCATE(lssqo(nsso,nsso,nl))
87 xssqo(:,:,:) = -99999.
88 lssqo(:,:,:) = .false.
89 IF (lhook) CALL dr_hook('INI_SSOWORK',1,zhook_handle)
90 !
91 !----------------------------------------------------------------------------
92 !
93 END SUBROUTINE ini_ssowork
subroutine ini_ssowork(PMESHLENGTH, PDLAT, PDLON)
Definition: ini_ssowork.F90:6