This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fortranformat as ff | |
def generate_first_line(MPAGE=1, NREF=1, MREF=1, IFSMV1=1, IFSMV2=1, ICOR1=1, ICOR2=1, IF3B=0, LD1=-3, LD2=-2, KSPEV=0, | |
KSPOT=2, NOMAX=1, IFCGS=0, KTSTEP=0): | |
fortran_format = ff.FortranRecordWriter('8(I1,1X),2(I2,1X),4(I1,1X),I6') | |
return fortran_format.write( | |
[MPAGE, NREF, MREF, IFSMV1, IFSMV2, ICOR1, ICOR2, IF3B, LD1, LD2, KSPEV, KSPOT, NOMAX, IFCGS, KTSTEP]) + '\n' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numba import cuda | |
import math | |
import numpy as np | |
import cupy as cp | |
from cupyx import optimizing | |
@cuda.jit(cache=True) | |
def calculate_part1(t, ivar, period, duration, t0, ivar_in, ivar_out): | |
# Thread index | |
tx = cuda.threadIdx.x |