Skip to content

Commit

Permalink
moved to new xsections
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholaswogan committed Sep 26, 2024
1 parent a56cd5e commit d241df6
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 236 deletions.
22 changes: 2 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
.DS_Store
.ipynb_checkpoints
__pycache__
*.so
*.o
Photo.run
*.mod
build
*.a
a.out
test.run
*.dSYM
.vscode


src/Stringifor
build_dir
src/dependencies/lib
src/dependencies/include
src/dependencies/examples
src/dependencies/cmake
src/dependencies/modules

random.ipynb
data
*.so


1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,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.7")
set(PHOTOCHEM_CLIMA_DATA_VERSION "0.2.0")

set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/modules")

Expand Down
2 changes: 1 addition & 1 deletion clima/cython/AdiabatClimate.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ cdef class AdiabatClimate:
self._init_called = True

if data_dir == None:
data_dir_ = os.path.dirname(os.path.realpath(__file__))+'/data'
data_dir_ = photochem_clima_data.DATA_DIR
else:
data_dir_ = data_dir

Expand Down
1 change: 1 addition & 0 deletions clima/cython/_clima.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from cpython.object cimport PyObject_GenericSetAttr
import numpy as np
import ctypes as ct
import os
import photochem_clima_data

DEF S_STR_LEN = 20;
DEF ERR_LEN = 1024;
Expand Down
16 changes: 16 additions & 0 deletions src/clima_useful.f90
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
module clima_useful
use clima_const, only: dp
use minpack_module, only: fcn_hybrj
use h5fortran, only: hdf5_file
implicit none
private

public :: hdf5_file_closer
public :: MinpackHybrd1Vars, MinpackHybrj
public :: linear_solve

! Helps close hdf5 files
type :: hdf5_file_closer
type(hdf5_file), pointer :: h => null()
contains
final :: hdf5_file_closer_final
end type

type :: MinpackHybrd1Vars
integer :: n
real(dp), allocatable :: x(:)
Expand Down Expand Up @@ -64,6 +73,13 @@ subroutine dgesv(n, nrhs, a, lda, ipiv, b, ldb, info)

contains

subroutine hdf5_file_closer_final(self)
type(hdf5_file_closer), intent(inout) :: self
if (associated(self%h)) then
if (self%h%is_open) call self%h%close()
endif
end subroutine

function create_MinpackHybrd1Vars(n, tol) result(v)
integer, intent(in) :: n
real(dp), optional, intent(in) :: tol
Expand Down
4 changes: 2 additions & 2 deletions src/dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ CPMAddPackage(
# futils
CPMAddPackage(
NAME futils
VERSION 0.1.13
VERSION 0.1.14
GITHUB_REPOSITORY "Nicholaswogan/futils"
GIT_TAG "v0.1.13"
GIT_TAG "v0.1.14"
EXCLUDE_FROM_ALL ON
)

Expand Down
Loading

0 comments on commit d241df6

Please sign in to comment.