diff --git a/CMakeLists.txt b/CMakeLists.txt index f4018ac..7768286 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION "3.14") cmake_policy(SET CMP0148 OLD) # To suppress a warning emerging from scikit-build -project(Clima LANGUAGES Fortran C VERSION "0.4.5") +project(Clima LANGUAGES Fortran C VERSION "0.4.6") set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/modules") diff --git a/clima/cython/AdiabatClimate.pyx b/clima/cython/AdiabatClimate.pyx index 1c72d09..8a02dc2 100644 --- a/clima/cython/AdiabatClimate.pyx +++ b/clima/cython/AdiabatClimate.pyx @@ -29,8 +29,8 @@ cdef class AdiabatClimate: raise ClimaException('The "__init__" method of AdiabatClimate has not been called.') PyObject_GenericSetAttr(self, name, value) - def __init__(self, species_file = None, settings_file = None, - flux_file = None, data_dir = None, cbool double_radiative_grid = True): + def __init__(self, str species_file, str settings_file, + str flux_file, data_dir = None, cbool double_radiative_grid = True): """Initializes `AdiabatClimate` Parameters @@ -379,7 +379,7 @@ cdef class AdiabatClimate: if len(err.strip()) > 0: raise ClimaException(err.decode("utf-8").strip()) - def out2atmosphere_txt(self, filename, ndarray[double, ndim=1] eddy, cbool overwrite = False, cbool clip = True): + def out2atmosphere_txt(self, str filename, ndarray[double, ndim=1] eddy, cbool overwrite = False, cbool clip = True): """Saves state of the atmosphere to a file. Parameters diff --git a/src/adiabat/clima_adiabat.f90 b/src/adiabat/clima_adiabat.f90 index 45e5191..99d1cea 100644 --- a/src/adiabat/clima_adiabat.f90 +++ b/src/adiabat/clima_adiabat.f90 @@ -950,11 +950,13 @@ subroutine AdiabatClimate_to_regular_grid(self, err) end subroutine subroutine AdiabatClimate_out2atmosphere_txt(self, filename, eddy, overwrite, clip, err) + use futils, only: FileCloser class(AdiabatClimate), target, intent(inout) :: self character(len=*), intent(in) :: filename real(dp), intent(in) :: eddy(:) logical, intent(in) :: overwrite, clip character(:), allocatable, intent(out) :: err + type(FileCloser) :: file character(len=100) :: tmp integer :: io, i, j @@ -969,12 +971,14 @@ subroutine AdiabatClimate_out2atmosphere_txt(self, filename, eddy, overwrite, cl if (overwrite) then open(2, file=filename, form='formatted', status='replace', iostat=io) + file%unit = 2 if (io /= 0) then err = "Unable to overwrite file "//trim(filename) return endif else open(2, file=filename, form='formatted', status='new', iostat=io) + file%unit = 2 if (io /= 0) then err = "Unable to create file "//trim(filename)//" because it already exists" return @@ -1012,8 +1016,6 @@ subroutine AdiabatClimate_out2atmosphere_txt(self, filename, eddy, overwrite, cl enddo enddo - close(2) - end subroutine !> For considering a tidally locked planet. This function computes key parameters for diff --git a/src/dependencies/CMakeLists.txt b/src/dependencies/CMakeLists.txt index 0471ba0..4a9dba0 100644 --- a/src/dependencies/CMakeLists.txt +++ b/src/dependencies/CMakeLists.txt @@ -22,9 +22,9 @@ CPMAddPackage( # futils CPMAddPackage( NAME futils - VERSION 0.1.9 + VERSION 0.1.11 GITHUB_REPOSITORY "Nicholaswogan/futils" - GIT_TAG "v0.1.9" + GIT_TAG "v0.1.11" EXCLUDE_FROM_ALL ON )