SURFEX v8.1
General documentation of Surfex
write_diag_ch_snapn.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 write_diag_ch_snap_n (DTCO, HSELECT, U, CHN, HPROGRAM)
7 ! #################################
8 !
9 !!**** *WRITE_DIAG_CH_SNAP_n* - writes surface chemical emissions diagnostics
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !!
15 !!** METHOD
16 !! ------
17 !!
18 !!
19 !! REFERENCE
20 !! ---------
21 !!
22 !!
23 !! AUTHOR
24 !! ------
25 !! V. Masson & S. Queguiner *Meteo France*
26 !!
27 !! MODIFICATIONS
28 !! -------------
29 !! Original 01/2012
30 !! M.Leriche 04/2014 change emissions name EMIS_ -> E_ name for coherence with PGD
31 !! change length of CHARACTER for emission 6->12
32 !!-------------------------------------------------------------------------------
33 !
34 !* 0. DECLARATIONS
35 ! ------------
36 !
38 USE modd_surf_atm_n, ONLY : surf_atm_t
40 !
41 USE modd_csts, ONLY : xavogadro
42 USE modi_init_io_surf_n
44 USE modi_end_io_surf_n
45 !
46 !
47 USE yomhook ,ONLY : lhook, dr_hook
48 USE parkind1 ,ONLY : jprb
49 !
50 IMPLICIT NONE
51 !
52 !* 0.1 Declarations of arguments
53 ! -------------------------
54 !
55 !
56 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
57  CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: HSELECT
58 TYPE(surf_atm_t), INTENT(INOUT) :: U
59 TYPE(ch_emis_snap_t), INTENT(INOUT) :: CHN
60 !
61  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling
62 !
63 !* 0.2 Declarations of local variables
64 ! -------------------------------
65 !
66 
67 INTEGER :: IRESP ! IRESP : return-code if a problem appears
68  CHARACTER(LEN=16) :: YRECFM ! Name of the article to be read
69  CHARACTER(LEN=100):: YCOMMENT ! Comment string
70 !
71 INTEGER :: JSPEC
72 REAL(KIND=JPRB) :: ZHOOK_HANDLE
73 !
74 !-------------------------------------------------------------------------------
75 !
76 ! Initialisation for IO
77 !
78 IF (lhook) CALL dr_hook('WRITE_DIAG_CH_SNAP_n',0,zhook_handle)
79  CALL init_io_surf_n(dtco, u, hprogram,'FULL ','SURF ','WRITE','SURF_ATM_DIAGNOSTICS.OUT.nc')
80 !
81 !-------------------------------------------------------------------------------
82 !
83 ! Writes Emissions of all species
84 !
85 DO jspec=1,chn%NEMIS_NBR
86  yrecfm = "E_"//trim(chn%CEMIS_NAME(jspec))
87  ycomment = "Emission data at time t (ppm*m/s)"
88  CALL write_surf(hselect, hprogram,yrecfm,chn%XEMIS_FIELDS(:,jspec),iresp,hcomment=ycomment)
89 END DO
90 !
91 !-------------------------------------------------------------------------------
92 !
93 ! End of IO
94 !
95  CALL end_io_surf_n(hprogram)
96 IF (lhook) CALL dr_hook('WRITE_DIAG_CH_SNAP_n',1,zhook_handle)
97 !
98 !
99 END SUBROUTINE write_diag_ch_snap_n
static const char * trim(const char *name, int *n)
Definition: drhook.c:2383
subroutine write_diag_ch_snap_n(DTCO, HSELECT, U, CHN, HPROGRAM)
integer, parameter jprb
Definition: parkind1.F90:32
subroutine end_io_surf_n(HPROGRAM)
Definition: end_io_surfn.F90:7
logical lhook
Definition: yomhook.F90:15
subroutine init_io_surf_n(DTCO, U, HPROGRAM, HMASK, HSCHEME, HACTION
real, save xavogadro
Definition: modd_csts.F90:52