SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
write_file_masktopd.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 ! ##########################
7  SUBROUTINE write_file_masktopd(KI)
8 ! ##########################
9 !
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 !
15 !!** METHOD
16 !! ------
17 !
18 !! EXTERNAL
19 !! --------
20 !!
21 !! none
22 !!
23 !! IMPLICIT ARGUMENTS
24 !! ------------------
25 !!
26 !! REFERENCE
27 !! ---------
28 !!
29 !! AUTHOR
30 !! ------
31 !!
32 !! B. Vincendon * Meteo-France *
33 !!
34 !! MODIFICATIONS
35 !! -------------
36 !!
37 !! Original 11/2011
38 !! 03/2014 (B. Vincendon) modification of mask_surf files format
39 !-------------------------------------------------------------------------------
40 !
41 !* 0. DECLARATIONS
42 ! ------------
43 !
44 USE modd_topd_par, ONLY : nunit
45 USE modd_topodyn, ONLY : ccat, nncat
46 USE modd_coupling_topd, ONLY : nmaski, nnpix
47 USE modd_surf_par, ONLY : nundef
48 !
49 USE modi_open_file
50 USE modi_close_file
51 !
53 !
54 USE yomhook ,ONLY : lhook, dr_hook
55 USE parkind1 ,ONLY : jprb
56 !
57 IMPLICIT NONE
58 !
59 !* 0.1 declarations of arguments
60 !
61 INTEGER, INTENT(IN) :: ki ! Grid dimensions
62 !
63 !* 0.2 declarations of local variables
64 INTEGER :: jcat,jmesh,jpix
65  CHARACTER(LEN=50) :: yname
66 REAL(KIND=JPRB) :: zhook_handle
67 !-------------------------------------------------------------------------------
68 IF (lhook) CALL dr_hook('WRITE_FILE_MASKTOPD',0,zhook_handle)
69 !
70 !* 0. Initialization:
71 ! ---------------
72 !
73 DO jcat=1,nncat
74  !
75  yname = trim(ccat(jcat))//trim('.mask_surf')
76  !
77  CALL open_file('ASCII ',nunit,yname,'FORMATTED',haction='WRITE')
78  !
79  DO jmesh=1,ki
80  DO jpix=1,nnpix(jmesh)
81  IF (nmaski(jmesh,jcat,jpix)/=nundef)&
82  WRITE(nunit,*) jmesh,nmaski(jmesh,jcat,jpix)
83  ENDDO
84  ENDDO
85  !
86  CALL close_file('ASCII ',nunit)
87  !
88 ENDDO
89 !
90 IF (lhook) CALL dr_hook('WRITE_FILE_MASKTOPD',1,zhook_handle)
91 !
92 END SUBROUTINE write_file_masktopd
subroutine close_file(HPROGRAM, KUNIT)
Definition: close_file.F90:6
subroutine write_file_masktopd(KI)
subroutine open_file(HPROGRAM, KUNIT, HFILE, HFORM, HACTION, HACCESS, KRECL)
Definition: open_file.F90:6