source: LMDZ6/trunk/libf/misc/handle_err_m.F90 @ 3457

Last change on this file since 3457 was 3435, checked in by Laurent Fairhead, 6 years ago

"Historic" :-) commit merging the physics branch used for DYNAMICO with the LMDZ trunk.
The same physics branch can now be used seamlessly with the traditional lon-lat LMDZ
dynamical core and DYNAMICO.
Testing consisted in running a lon-lat LMDZ bucket simulation with the NPv6.1 physics package
with the original trunk sources and the merged sources. Tests were succesful in the sense that
numeric continuity was preserved in the restart files from both simulation. Further tests
included running both versions of the physics codes for one year in a LMDZOR setting in which
the restart files also came out identical.

Caution:

  • as the physics package now manages unstructured grids, grid information needs to be transmitted

to the surface scheme ORCHIDEE. This means that the interface defined in surf_land_orchidee_mod.F90
is only compatible with ORCHIDEE version orchidee2.1 and later versions. If previous versions of
ORCHIDEE need to be used, the CPP key ORCHIDEE_NOUNSTRUCT needs to be set at compilation time.
This is done automatically if makelmdz/makelmdz_fcm are called with the veget orchidee2.0 switch

  • due to a limitation in XIOS, the time at which limit conditions will be read in by DYNAMICO will be

delayed by one physic timestep with respect to the time it is read in by the lon-lat model. This is caused
by the line

IF (MOD(itime-1, lmt_pas) == 0 .OR. (jour_lu /= jour .AND. grid_type /= unstructured)) THEN ! time to read

in limit_read_mod.F90

Work still needed on COSP integration and XML files for DYNAMICO

EM, YM, LF

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 1.2 KB
Line 
1! $Id$
2module handle_err_m
3
4  implicit none
5
6contains
7
8  subroutine handle_err(message, ncerr, ncid, varid)
9
10    use netcdf, only: nf90_strerror, nf90_noerr, nf90_close
11
12    character(len=*), intent(in):: message
13    ! (should include name of calling procedure)
14
15    integer, intent(in):: ncerr
16
17    integer, intent(in), optional :: ncid
18    ! (Provide this argument if you want "handle_err" to try to close
19    ! the file.)
20
21    integer, intent(in), optional :: varid
22
23    ! Variable local to the procedure:
24    integer ncerr_close
25
26    !-------------------
27
28    if (ncerr /= nf90_noerr) then
29       print *, message, ":"
30       if (present(varid)) print *, "varid = ", varid
31       print *, trim(nf90_strerror(ncerr))
32       if (present(ncid)) then
33          ! Try to close, to leave the file in a consistent state:
34          ncerr_close = nf90_close(ncid)
35          ! (do not call "nf95_close", we do not want to recurse)
36          if (ncerr_close /= nf90_noerr) then
37             print *, "nf90_close:"
38             print *, trim(nf90_strerror(ncerr_close))
39          end if
40       end if
41       call abort_physic("NetCDF95 handle_err", "", 1)
42    end if
43
44  end subroutine handle_err
45
46end module handle_err_m
Note: See TracBrowser for help on using the repository browser.