forked from ESCOMP/FTorch_interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFTorch_cesm_interface.F90
More file actions
35 lines (34 loc) · 1.18 KB
/
FTorch_cesm_interface.F90
File metadata and controls
35 lines (34 loc) · 1.18 KB
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
27
28
29
30
31
32
33
34
35
module FTorch_cesm_interface
#ifdef USE_FTORCH
use ftorch, only: torch_kCPU, torch_tensor, torch_model, torch_tensor_from_array
use ftorch, only: torch_model_load, torch_model_forward
#else
use shr_abort_mod, only : shr_abort_abort
use shr_kind_mod, only : r8 => shr_kind_r8
type :: torch_model
end type torch_model
type :: torch_tensor
end type torch_tensor
integer :: torch_kcpu
character(len=*), parameter :: message="ERROR: Using FTorch Interface without USE_FTORCH=TRUE"
contains
subroutine torch_model_load(model, fname, i)
type(torch_model) :: model
character(len=*) :: fname
integer :: i
call shr_abort_abort(message)
end subroutine torch_model_load
subroutine torch_tensor_from_array(tensor, data, layout, i)
type(torch_tensor) :: tensor
real(r8) :: data(:,:)
integer :: layout(:)
integer :: i
call shr_abort_abort(message)
end subroutine torch_tensor_from_array
subroutine torch_model_forward(model, tensor_in, tensor_out)
type(torch_model) :: model
type(torch_tensor) :: tensor_in(:), tensor_out(:)
call shr_abort_abort(message)
end subroutine torch_model_forward
#endif
end module FTorch_cesm_interface