FV3 Bundle
fv3jedi_setup_mod.f90
Go to the documentation of this file.
1 ! (C) Copyright 2017-2018 UCAR
2 !
3 ! This software is licensed under the terms of the Apache Licence Version 2.0
4 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5 
6 ! ------------------------------------------------------------------------------
7 
9 
10 use iso_c_binding
11 use config_mod
12 
13 use mpp_mod, only: mpp_init, mpp_exit
14 use mpp_domains_mod, only: mpp_domains_init, mpp_domains_exit
16 
17 use mpp_domains_mod, only: mpp_domains_set_stack_size
18 use fckit_mpi_module,only: fckit_mpi_comm
19 use fms_mod, only: fms_init
20 
21 implicit none
22 private
23 
24 ! ------------------------------------------------------------------------------
25 
26 contains
27 
28 ! ------------------------------------------------------------------------------
29 
30 subroutine fv3jedi_setup(c_conf) bind(c,name='fv3jedi_setup_f')
31 
32 implicit none
33 
34 type(c_ptr), intent(in) :: c_conf
35 integer :: stackmax = 4000000
36 type(fckit_mpi_comm) :: f_comm
37 
38 f_comm = fckit_mpi_comm()
39 call mpp_init(localcomm=f_comm%communicator())
40 call mpp_domains_init
41 call fms_io_init
42 call fms_init()
43 
44 if (config_element_exists(c_conf,"stackmax")) stackmax = config_get_int(c_conf,"stackmax")
45 call mpp_domains_set_stack_size(stackmax)
46 
47 end subroutine fv3jedi_setup
48 
49 ! ------------------------------------------------------------------------------
50 
51 subroutine fv3jedi_finalize() bind(c,name='fv3jedi_finalize_f')
52 
53 implicit none
54 
55 call fms_io_exit
56 call mpp_domains_exit
57 !call mpp_exit
58 
59 end subroutine fv3jedi_finalize
60 
61 ! ------------------------------------------------------------------------------
62 
63 end module fv3jedi_setup_mod
Definition: fms.F90:20
subroutine fv3jedi_setup(c_conf)
subroutine fv3jedi_finalize()
Definition: mpp.F90:39
subroutine, public fms_init(localcomm)
Definition: fms.F90:353
subroutine, public fms_io_init()
Definition: fms_io.F90:638
subroutine, public fms_io_exit()
Definition: fms_io.F90:750