forked from mom-ocean/MOM6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunpyF.F90
More file actions
26 lines (21 loc) · 871 Bytes
/
runpyF.F90
File metadata and controls
26 lines (21 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
!Inspired by https://github.com/wangsl/python-embedding
!
module MOM_python_embedding
implicit none
public runPyF_1_3d
contains
subroutine runpyF_1_3d(pyScript, pyFunction, varname, x)
character(len=*), intent(in) :: pyScript, pyFunction,varname
real, dimension(:,:,:), intent(inout) :: x
integer :: n1,n2,n3, len_pyScript, len_pyFunction , len_varname
len_pyScript = Len_Trim(pyScript)
if(pyScript(len_pyScript-2:len_pyScript) .eq. '.py') len_pyScript = len_pyScript-3
len_pyFunction = Len_Trim(pyFunction)
len_varname = Len_Trim(varname)
n1 = size(x,1)
n2 = size(x,2)
n3 = size(x,3)
call runpyc_1array3d(pyScript, len_pyScript, pyFunction, len_pyFunction,&
varname, len_varname, x, n1,n2,n3)
end subroutine runpyF_1_3d
end module MOM_python_embedding